From d54591216efd17238fa8df7f6d85f4195b89d683 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 10 Dec 2015 11:29:31 -0800 Subject: [PATCH] Remove wfForeignMemcKey() usage from JobQueueRedis::getQueueKey() This class should manage the escaping it uses, rather than use some random BagOStuff that has nothing to do with the job queue. Change-Id: Ie716dc4a3429754a99c5f0670555e5e049b61aa1 --- includes/jobqueue/JobQueueRedis.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php index 3e7bdcc588..67420f0957 100644 --- a/includes/jobqueue/JobQueueRedis.php +++ b/includes/jobqueue/JobQueueRedis.php @@ -797,13 +797,17 @@ LUA; /** * @param string $prop - * @param string|null $type + * @param string|null $type Override this for sibling queues * @return string */ private function getQueueKey( $prop, $type = null ) { $type = is_string( $type ) ? $type : $this->type; list( $db, $prefix ) = wfSplitWikiID( $this->wiki ); + $keyspace = $prefix ? "$db-$prefix" : $db; - return wfForeignMemcKey( $db, $prefix, 'jobqueue', $type, $prop ); + $parts = array( $keyspace, 'jobqueue', $type, $prop ); + + // Parts are typically ASCII, but encode for sanity to escape ":" + return implode( ':', array_map( 'rawurlencode', $parts ) ); } } -- 2.20.1