preview functionality was broken for doc comments in the admin interface
ever since we switched to https. I think best would be to remove it but
given the fact that the website code is soon going to be rewritten anyway
just hack around the issue.
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2627
8f5c7a92-453e-0410-a47f-
ad33c8a6b003
// Preview is only allowed when called from /admin interface.
// Just to prevent stupidities, we know referer check isn't
// actually secure, but it's good enough.
- if (getenv('HTTP_REFERER') !=
+ if ( preg_replace("/^https/","http",$_SERVER['HTTP_REFERER']) !=
$_SETTINGS['masterserver'] . '/admin/comments.php')
throw new Exception('Invalid referer');
$this->preview=1;