[aur-dev] [PATCH] Add check for if PATH_INFO exists

Mark Weiman mark.weiman at markzz.com
Sat Feb 4 23:35:57 UTC 2017


When running aurweb with the command line php server and / is visited, it will
give an undefined index notice. This will add a check if it exists and will
prevent the notice.

Signed-off-by: Mark Weiman <mark.weiman at markzz.com>
---
 web/html/index.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/html/index.php b/web/html/index.php
index 78ab6ad..3bdf281 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -4,7 +4,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
 include_once("aur.inc.php");
 include_once("pkgfuncs.inc.php");
 
-$path = $_SERVER['PATH_INFO'];
+$path = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "/";
 $tokens = explode('/', $path);
 
 if (config_get_bool('options', 'enable-maintenance') && (empty($tokens[1]) || ($tokens[1] != "css" && $tokens[1] != "images"))) {
-- 
2.11.0


More information about the aur-dev mailing list