]> source.dussan.org Git - nextcloud-server.git/commitdiff
check limit of serialized command in unit tests
authorRobin Appelman <icewind@owncloud.com>
Tue, 24 Mar 2015 09:48:21 +0000 (10:48 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 26 Mar 2015 16:07:02 +0000 (17:07 +0100)
lib/private/command/queuebus.php

index e5604eb1fef2148cea977b9c12b18bf40cf1a97f..78712ebd9cdb01187204dc2dda4015e78cf07ed6 100644 (file)
@@ -41,6 +41,9 @@ class QueueBus implements IBus {
                if ($command instanceof ICommand) {
                        // ensure the command can be serialized
                        $serialized = serialize($command);
+                       if(strlen($serialized) > 4000) {
+                               throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
+                       }
                        $unserialized = unserialize($serialized);
                        $unserialized->handle();
                } else {