From: Evan Prodromou Date: Fri, 20 Feb 2009 21:44:56 +0000 (-0500) Subject: avoid notices on undefined array elements X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5c59c0d90c806636fc07ee9f2445407ad277de59;p=quix0rs-gnu-social.git avoid notices on undefined array elements --- diff --git a/index.php b/index.php index b180e2b653..a8890e9a3b 100644 --- a/index.php +++ b/index.php @@ -27,12 +27,13 @@ $action = null; 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']; - } else if ($_SERVER['PATH_INFO']) { + } else if (array_key_exists('PATH_INFO', $_SERVER)) { return $_SERVER['PATH_INFO']; } else { - return $req['p']; + return null; } }