summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-20 08:00:40 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-20 08:00:40 +0000
commitc032df51d827366585c829f9633e32cf1938b358 (patch)
tree9971199634a8925f5d726c37876ff8ebc9effd57 /roundcubemail/program
parentf77d491f791077a9704b3149cb8fcd50a0ec2484 (diff)
- Fix error when rcube_cache::remove() was used in pattern mode
git-svn-id: https://svn.roundcube.net/trunk@4791 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/rcube_cache.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_cache.php b/roundcubemail/program/include/rcube_cache.php
index 2fe5903b4..abadeedbc 100644
--- a/roundcubemail/program/include/rcube_cache.php
+++ b/roundcubemail/program/include/rcube_cache.php
@@ -152,7 +152,14 @@ class rcube_cache
$this->cache_changes = array();
}
else if ($pattern_mode) {
- $key = $this->prefix.$key;
+ // add cache prefix into PCRE expression
+ if (preg_match('/^(.)([^a-z0-9]*).*/i', $key, $matches)) {
+ $key = $matches[1] . $matches[2] . preg_quote($this->prefix, $matches[1])
+ . substr($key, strlen($matches[1].$matches[2]));
+ }
+ else {
+ $key = $this->prefix.$key;
+ }
foreach (array_keys($this->cache) as $k) {
if (preg_match($key, $k)) {