]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
avoid notices on undefined array elements
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 20 Feb 2009 21:44:56 +0000 (16:44 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 20 Feb 2009 21:44:56 +0000 (16:44 -0500)
index.php

index b180e2b653b285f2c54585d83d7558e170f7e74d..a8890e9a3b673e9866fd1014c89884d055f6b4ec 100644 (file)
--- 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;
     }
 }