Skip to content

Commit

Permalink
#598: Fixed undefined index: path in misc.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy Ton committed Jan 17, 2012
1 parent fcf840c commit e793d7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions misc.php
Expand Up @@ -145,11 +145,19 @@
if (strpos($referrer['host'], 'www.') === 0)
$referrer['host'] = substr($referrer['host'], 4);

// Make sure the path component exists
if (!isset($referrer['path']))
$referrer['path'] = '';

$valid = parse_url(get_base_url());
// Remove www subdomain if it exists
if (strpos($valid['host'], 'www.') === 0)
$valid['host'] = substr($valid['host'], 4);

// Make sure the path component exists
if (!isset($valid['path']))
$valid['path'] = '';

if ($referrer['host'] == $valid['host'] && preg_match('%^'.preg_quote($valid['path'], '%').'/(.*?)\.php%i', $referrer['path']))
$redirect_url = $_SERVER['HTTP_REFERER'];
}
Expand Down

0 comments on commit e793d7e

Please sign in to comment.