summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy2017-07-12 06:13:55 (GMT)
committerJeremy Andrews2017-07-12 06:13:55 (GMT)
commitdd9625d9f4589a8687538166e507316d4d70b73b (patch)
treea52e0470135a10227db21deead37091d7c3551cc
parent9d2589823d1fd2160fa6361eec422e841b7f5843 (diff)
Issue #1305696 by Jeremy: substr() expects parameter 3 to be long, string given memcache.inc
-rw-r--r--memcache.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/memcache.inc b/memcache.inc
index 81c8a4a..39ca4a5 100644
--- a/memcache.inc
+++ b/memcache.inc
@@ -333,6 +333,11 @@ function memcache_wildcard_flushes($cid, $table) {
function memcache_wildcards($cid, $table, $flush = FALSE) {
static $wildcards = array();
$matching = array();
+ if (!is_string($cid) && !is_int($cid)) {
+ register_shutdown_function('watchdog', 'memcache', 'Invalid cache id received in memcache.inc wildcards() of type !type.', array('!type' => gettype($cid)), WATCHDOG_ERROR);
+ return $matching;
+ }
+
$length = strlen($cid);
$wildcard_flushes = variable_get('memcache_wildcard_flushes', array());