Switch to LOCK IN SHARE MODE in recordUpload2()
[lhc/web/wiklou.git] / includes / Status.php
index 77bf4a8..0a8062c 100644 (file)
@@ -64,7 +64,7 @@ class Status {
        /**
         * Factory function for fatal errors
         *
-        * @param string|Message $message message name or object
+        * @param string|Message $message Message name or object
         * @return Status
         */
        static function newFatal( $message /*, parameters...*/ ) {
@@ -159,6 +159,15 @@ class Status {
                $this->ok = false;
        }
 
+       /**
+        * Don't save the callback when serializing, because Closures can't be
+        * serialized and we're going to clear it in __wakeup anyway.
+        */
+       public function __sleep() {
+               $keys = array_keys( get_object_vars( $this ) );
+               return array_diff( $keys, array( 'cleanCallback' ) );
+       }
+
        /**
         * Sanitize the callback parameter on wakeup, to avoid arbitrary execution.
         */
@@ -184,9 +193,9 @@ class Status {
        /**
         * Get the error list as a wikitext formatted list
         *
-        * @param string $shortContext A short enclosing context message name, to
+        * @param string|bool $shortContext A short enclosing context message name, to
         *        be used when there is a single error
-        * @param string $longContext A long enclosing context message name, for a list
+        * @param string|bool $longContext A long enclosing context message name, for a list
         * @return string
         */
        public function getWikiText( $shortContext = false, $longContext = false ) {