fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9856] controller: fix unmarshal : allow incoming 0 a


From: Sigurd Nes
Subject: [Fmsystem-commits] [9856] controller: fix unmarshal : allow incoming 0 as integer and add boolean and string as types
Date: Wed, 15 Aug 2012 07:25:40 +0000

Revision: 9856
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9856
Author:   sigurdne
Date:     2012-08-15 07:25:40 +0000 (Wed, 15 Aug 2012)
Log Message:
-----------
controller:  fix unmarshal : allow incoming 0 as integer and add boolean and 
string as types

Modified Paths:
--------------
    trunk/controller/inc/class.socommon.inc.php

Modified: trunk/controller/inc/class.socommon.inc.php
===================================================================
--- trunk/controller/inc/class.socommon.inc.php 2012-08-15 07:23:04 UTC (rev 
9855)
+++ trunk/controller/inc/class.socommon.inc.php 2012-08-15 07:25:40 UTC (rev 
9856)
@@ -93,18 +93,26 @@
                        {
                                return (boolean)$value;
                        }
-                       elseif($value === null || $value == 'NULL')
+                       else if($type == 'boolean')
                        {
-                               return null;
+                               return (boolean) $value;
                        }
-                       elseif($type == 'int')
+                       else if($type == 'int')
                        {
-                               return intval($value);
+                               return (int) $value;
                        }
-                       elseif($type == 'float')
+                       else if($type == 'float')
                        {
-                               return floatval($value);
+                               return (float) $value;
                        }
+                       else if($type == 'string')
+                       {
+                               return (string) $value;
+                       }
+                       else if($value === null || $value == 'NULL')
+                       {
+                               return null;
+                       }
                        return $value;
                }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]