You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2012/11/29 21:50:42 UTC

svn commit: r1415371 - /vcl/trunk/web/.ht-inc/utils.php

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])) {