Skip to content
Snippets Groups Projects
Verified Commit 8e108c0d authored by Alberto Paderno's avatar Alberto Paderno
Browse files

Revert issue #2183285: Use \Q...\E for regex literals

parent 258b1384
No related branches found
No related tags found
1 merge request!1Revert issue #2183285: Use \Q...\E for regex literals
......@@ -243,7 +243,8 @@ function set($cid, $data, $expire = CACHE_PERMANENT, array $headers = NULL) {
*/
protected function deletePrefix($prefix) {
if (class_exists('APCIterator')) {
$iterator = new APCIterator('user', '/^\Q' . $this->binKey() . $prefix . '\E/', APC_ITER_KEY);
$escapedKey = preg_quote($this->binKey() . $prefix, '/');
$iterator = new APCIterator('user', '/^' . $escapedKey . '/', APC_ITER_KEY);
foreach ($iterator as $key => $data) {
apc_delete($key);
}
......@@ -293,7 +294,8 @@ function clear($cid = NULL, $wildcard = FALSE) {
function isEmpty() {
if (class_exists('APCIterator')) {
$iterator = new APCIterator('user', '/^\Q' . $this->binKey() . '\E/', APC_ITER_KEY);
$escapedKey = preg_quote($this->binKey(), '/');
$iterator = new APCIterator('user', '/^' . $escapedKey . '/', APC_ITER_KEY);
return 0 === $iterator->getTotalCount();
}
return TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment