(bug 43852) Fix converttitles param in api.php?action=query
[lhc/web/wiklou.git] / includes / json / Services_JSON.php
index 5261a6a..2566072 100644 (file)
@@ -136,7 +136,7 @@ class Services_JSON
        {
                $this->use = $use;
        }
-       
+
        private static $mHavePear = null;
        /**
         * Returns cached result of class_exists('pear'), to avoid calling AutoLoader numerous times
@@ -283,7 +283,7 @@ class Services_JSON
                return $this->encode2($var);
        }
 
-       /**
+       /**
         * encodes an arbitrary variable into JSON format
         *
         * @param $var Mixed: any number, boolean, string, array, or object to be encoded.
@@ -826,6 +826,7 @@ class Services_JSON
 
        /**
         * @todo Ultimately, this should just call PEAR::isError()
+        * @return bool
         */
        function isError($data, $code = null)
        {
@@ -870,7 +871,12 @@ if (class_exists('PEAR_Error')) {
                function Services_JSON_Error($message = 'unknown error', $code = null,
                                                $mode = null, $options = null, $userinfo = null)
                {
+                       $this->message = $message;
+               }
 
+               function __toString()
+               {
+                       return $this->message;
                }
        }
 }