Make sure $_SERVER['HTTP_REFERER'] isset when testing value

This commit is contained in:
Mikael Nordfeldth 2016-03-31 20:51:50 +02:00
parent 299949b156
commit 44ea8aa681

View File

@ -266,7 +266,8 @@ function common_logged_in()
function common_local_referer()
{
return parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) === common_config('site', 'server');
return isset($_SERVER['HTTP_REFERER'])
&& parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) === common_config('site', 'server');
}
function common_have_session()