avoid notices on undefined array elements
This commit is contained in:
parent
76d506cf16
commit
5c59c0d90c
@ -27,12 +27,13 @@ $action = null;
|
|||||||
|
|
||||||
function getPath($req)
|
function getPath($req)
|
||||||
{
|
{
|
||||||
if (common_config('site', 'fancy')) {
|
if ((common_config('site', 'fancy') || !array_key_exists('PATH_INFO', $_SERVER))
|
||||||
|
&& array_key_exists('p', $req)) {
|
||||||
return $req['p'];
|
return $req['p'];
|
||||||
} else if ($_SERVER['PATH_INFO']) {
|
} else if (array_key_exists('PATH_INFO', $_SERVER)) {
|
||||||
return $_SERVER['PATH_INFO'];
|
return $_SERVER['PATH_INFO'];
|
||||||
} else {
|
} else {
|
||||||
return $req['p'];
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user