Advertisement
Guest User

Untitled

a guest
Jan 6th, 2011
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.86 KB | None | 0 0
  1. Index: XmlRpc/Value.php
  2. ===================================================================
  3. --- XmlRpc/Value.php    (revision 23621)
  4. +++ XmlRpc/Value.php    (working copy)
  5. @@ -321,49 +321,31 @@
  6.                  require_once 'Zend/XmlRpc/Value/DateTime.php';
  7.                  return new Zend_XmlRpc_Value_DateTime($value);
  8.  
  9. -                if ($value instanceof Zend_Crypt_Math_BigInteger) {
  10. -                    require_once 'Zend/XmlRpc/Value/BigInteger.php';
  11. -                    return new Zend_XmlRpc_Value_BigInteger($value);
  12. -                }
  13. -
  14. -                if ($value instanceof Zend_Date or $value instanceof DateTime) {
  15. -                    require_once 'Zend/XmlRpc/Value/DateTime.php';
  16. -                    return new Zend_XmlRpc_Value_DateTime($value);
  17. -                }
  18. -
  19. -                // Otherwise, we convert the object into a struct
  20. -                $value = get_object_vars($value);
  21. -                // Break intentionally omitted
  22. -            case 'array':
  23. -                // Default native type for a PHP array (a simple numeric array) is 'array'
  24. +            case self::XMLRPC_TYPE_ARRAY:
  25.                  require_once 'Zend/XmlRpc/Value/Array.php';
  26. -                $obj = 'Zend_XmlRpc_Value_Array';
  27. +                return new Zend_XmlRpc_Value_Array($value);
  28.  
  29. -                // Determine if this is an associative array
  30. -                if (!empty($value) && is_array($value) && (array_keys($value) !== range(0, count($value) - 1))) {
  31. -                    require_once 'Zend/XmlRpc/Value/Struct.php';
  32. -                    $obj = 'Zend_XmlRpc_Value_Struct';
  33. -                }
  34. -                return new $obj($value);
  35. +            case self::XMLRPC_TYPE_STRUCT:
  36. +                require_once 'Zend/XmlRpc/Value/Struct.php';
  37. +                return new Zend_XmlRpc_Value_Struct($value);
  38.  
  39. -            case 'integer':
  40. +            case self::XMLRPC_TYPE_INTEGER:
  41.                  require_once 'Zend/XmlRpc/Value/Integer.php';
  42.                  return new Zend_XmlRpc_Value_Integer($value);
  43.  
  44. -            case 'double':
  45. +            case self::XMLRPC_TYPE_DOUBLE:
  46.                  require_once 'Zend/XmlRpc/Value/Double.php';
  47.                  return new Zend_XmlRpc_Value_Double($value);
  48.  
  49. -            case 'boolean':
  50. +            case self::XMLRPC_TYPE_BOOLEAN:
  51.                  require_once 'Zend/XmlRpc/Value/Boolean.php';
  52.                  return new Zend_XmlRpc_Value_Boolean($value);
  53.  
  54. -            case 'NULL':
  55. -            case 'null':
  56. +            case self::XMLRPC_TYPE_NIL:
  57.                  require_once 'Zend/XmlRpc/Value/Nil.php';
  58.                  return new Zend_XmlRpc_Value_Nil();
  59.  
  60. -            case 'string':
  61. +            case self::XMLRPC_TYPE_STRING:
  62.                  // Fall through to the next case
  63.              default:
  64.                  // If type isn't identified (or identified as string), it treated as string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement