[art-web] [download] check 'PATH_INFO' exists in $_SERVER before accessing it



commit 6581ecb80afeaf6fd4300c7c84a482bbb38fd359
Author: Thomas Wood <thos gnome org>
Date:   Sat Oct 31 22:53:34 2009 +0000

    [download] check 'PATH_INFO' exists in $_SERVER before accessing it
    
    Accessing an non-existent index in an array will cause PHP to generate a
    warning.

 download |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/download b/download
index 120944d..fa4343f 100644
--- a/download
+++ b/download
@@ -4,7 +4,10 @@ require("mysql.inc.php");
 require("common.inc.php");
 
 // superglobal stuff
-$request = $_SERVER["PATH_INFO"];
+if (array_key_exists ('PATH_INFO', request))
+  $request = $_SERVER['PATH_INFO'];
+else
+  $request = '';
 
 if (array_key_exists ('d', $_GET))
   list($foo,$section,$category,$download_num,$filename) = explode("/", $_GET['d']);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]