|
From: <luc...@us...> - 2014-07-25 19:37:54
|
Revision: 12728
http://sourceforge.net/p/xoops/svn/12728
Author: luciorota
Date: 2014-07-25 19:37:50 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
XoopsRequest::getArray($name, $default = array(), $hash = 'default')
If $name is not an array but it should be, method converts $name in an array.
This change is important when a select box contain only 1 option (eg: XoopsFormCheckBox)
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsrequest.php
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsrequest.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsrequest.php 2014-07-25 17:48:46 UTC (rev 12727)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsrequest.php 2014-07-25 19:37:50 UTC (rev 12728)
@@ -429,6 +429,11 @@
$var = trim($var);
}
+ // convert $var in array if $type is ARRAY
+ if (strtoupper($type)) == 'ARRAY' && !is_array($var)) {
+ $var = array($var);
+ }
+
// Now we handle input filtering
if ($mask & 2) {
// If the allow raw flag is set, do not modify the variable
|