diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-02-20 16:44:56 -0500 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-02-20 16:44:56 -0500 |
commit | 5c59c0d90c806636fc07ee9f2445407ad277de59 (patch) | |
tree | f47eeb2c2e0902aff19129d81ec18d1b61116e67 | |
parent | 76d506cf1644390a073e5178774675c60e1c3332 (diff) |
avoid notices on undefined array elements
-rw-r--r-- | index.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } } |