From 8c903c100ff6517806e5328ef56d615f5c93490b Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Tue, 24 Mar 2015 10:48:21 +0100
Subject: [PATCH] check limit of serialized command in unit tests

---
 lib/private/command/queuebus.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/private/command/queuebus.php b/lib/private/command/queuebus.php
index e5604eb1fe..78712ebd9c 100644
--- a/lib/private/command/queuebus.php
+++ b/lib/private/command/queuebus.php
@@ -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 {
-- 
GitLab