Destroying object type processor upon serialization
authorAlexander Ebert <ebert@woltlab.com>
Sun, 18 Nov 2012 22:04:06 +0000 (23:04 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 18 Nov 2012 22:04:06 +0000 (23:04 +0100)
SingletonFactory does not allow serialization, therefore we need to remove it (as an object type can be serialized by design).

wcfsetup/install/files/lib/data/object/type/ObjectType.class.php

index 3727de9a17a43e8e3776ae01923b17c47c5f50d6..3434ebea6e453999661c0f8449cb97ea727500a8 100644 (file)
@@ -41,6 +41,15 @@ class ObjectType extends ProcessibleDatabaseObject {
                return $value;
        }
        
+       /**
+        * Destroies processor if attempting to serialize.
+        */
+       public final function __sleep() {
+               if ($this->processor !== null) {
+                       $this->processor = null;
+               }
+       }
+       
        /**
         * @see wcf\data\DatabaseObject::handleData()
         */