Author: jfthomps
Date: Thu Nov 29 20:50:40 2012
New Revision: 1415371

URL: http://svn.apache.org/viewvc?rev=1415371&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/trunk/web/.ht-inc/utils.php

Modified: vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1415371&r1=1415370&r2=1415371&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Thu Nov 29 20:50:40 2012
@@ -3107,13 +3107,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