Author: jfthomps
Date: Thu Nov 29 20:07:18 2012
New Revision: 1415348

URL: http://svn.apache.org/viewvc?rev=1415348&view=rev
Log:
VCL-650
VCL breaks with PHP 5.4

utils.php: modified processInputVar - added checks for input variable being an 
array before checking if it should be changed to 'zero'

Modified:
    vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/utils.php

Modified: vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/utils.php?rev=1415348&r1=1415347&r2=1415348&view=diff
==============================================================================
--- vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/utils.php (original)
+++ vcl/branches/vcl-2.3-bugfixes/web/.ht-inc/utils.php Thu Nov 29 20:07:18 2012
@@ -3080,13 +3080,15 @@ function getAffiliationTheme($affilid) {
 
////////////////////////////////////////////////////////////////////////////////
 function processInputVar($vartag, $type, $defaultvalue=NULL, 
$stripwhitespace=0) {
        if((array_key_exists($vartag, $_POST) &&
-          strncmp("$_POST[$vartag]", "0", 1) == 0 &&
+          ! is_array($_POST[$vartag]) &&
+          strncmp("{$_POST[$vartag]}", "0", 1) == 0 &&
           $type == ARG_NUMERIC &&
-               strncmp("$_POST[$vartag]", "0x0", 3) != 0) ||
+               strncmp("{$_POST[$vartag]}", "0x0", 3) != 0) ||
           (array_key_exists($vartag, $_GET) && 
-          strncmp("$_GET[$vartag]", "0", 1) == 0 &&
+          ! is_array($_GET[$vartag]) &&
+          strncmp("{$_GET[$vartag]}", "0", 1) == 0 &&
           $type == ARG_NUMERIC &&
-               strncmp("$_GET[$vartag]", "0x0", 3) != 0)) {
+               strncmp("{$_GET[$vartag]}", "0x0", 3) != 0)) {
                $_POST[$vartag] = "zero";
        }
        if(!empty($_POST[$vartag])) {


Reply via email to