diff options
author | alecpl <alec@alec.pl> | 2011-05-20 08:00:40 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-05-20 08:00:40 +0000 |
commit | 7786ba1adb415fc8fd4478380d7201702a799483 (patch) | |
tree | afef46ddf3f0049e2e2fc242b9af61bc0f318213 /program | |
parent | d2a64865a7089133345dc9eed63ddab691d43575 (diff) |
- Fix error when rcube_cache::remove() was used in pattern mode
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_cache.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/program/include/rcube_cache.php b/program/include/rcube_cache.php index 2fe5903b4..abadeedbc 100644 --- a/program/include/rcube_cache.php +++ b/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)) { |