diff options
author | diosmosis <benaka@piwik.pro> | 2015-03-28 09:48:13 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-03-28 09:48:13 +0300 |
commit | eb816e39e6bfd050f8bda3851bacb72f38a1ec61 (patch) | |
tree | f91a5a5787e4acbf776aa3711a4155d399cf6820 /core/Concurrency/DistributedList.php | |
parent | f595087622b06707a67d761e07cf0147f0ace6b5 (diff) |
Refs #7560, avoid array to string conversion notice in DistributedList & descendents. Throws exception instead so a stack trace can be found.
Diffstat (limited to 'core/Concurrency/DistributedList.php')
-rw-r--r-- | core/Concurrency/DistributedList.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/Concurrency/DistributedList.php b/core/Concurrency/DistributedList.php index eecfab6a55..6c6ce340c0 100644 --- a/core/Concurrency/DistributedList.php +++ b/core/Concurrency/DistributedList.php @@ -62,8 +62,12 @@ class DistributedList */ public function setAll($items) { - foreach ($items as &$item) { - $item = (string)$item; + foreach ($items as $key => &$item) { + if (is_array($item)) { + throw new \InvalidArgumentException("Array item encountered in DistributedList::setAll() [ key = $key ]."); + } else { + $item = (string)$item; + } } Option::set($this->optionName, serialize($items)); |