Chris Morgan : filter_gpc() fix for "Fatal error: type of variable X is not recognized".

Chris Morgan cmorgan at winehq.org
Sun Sep 14 10:11:18 CDT 2008


Module: appdb
Branch: master
Commit: f8fb363ce42eba353ac74f7871cb3663b2b9df0a
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=f8fb363ce42eba353ac74f7871cb3663b2b9df0a

Author: Chris Morgan <cmorgan at alum.wpi.edu>
Date:   Sun Sep 14 11:19:08 2008 -0400

filter_gpc() fix for "Fatal error: type of variable X is not recognized".

Ignore unknown gpc variables instead of failing with fatal errors as it isn't useful to report these errors to users. Firewalls or other programs may be inserting these cookies.
Properly store array variables if they are valid arrays.

---

 include/filter.php |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/filter.php b/include/filter.php
index 4daf875..404e3a1 100644
--- a/include/filter.php
+++ b/include/filter.php
@@ -94,17 +94,16 @@ function filter_gpc()
                 }
             break;
             case "a": // array
-                 if(!is_array($_REQUEST[$aKeys[$i]]))
-                     return "Fatal error: ".$aKeys[$i]." should be an array. ".
-                            $sErrorSuggestion;
+                // store the value if it is an array
+                if(is_array($_REQUEST[$aKeys[$i]]))
+                    $aClean[$aKeys[$i]] = $_REQUEST[$aKeys[$i]];
             break;
             default:
-                return "Fatal error: type of variable ".$aKeys[$i]." is not recognized.".
-                       $sErrorSuggestion;
+                // type not recognized, skip it
                 break;
         }
     }
-    
+
     /* null out all input data so we can be assured that */
     /* no unfiltered values are being used */
     $_REQUEST = array();




More information about the wine-cvs mailing list