diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-01 10:27:47 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-01 10:27:47 +0200 |
commit | d26436944173d1fa28a1abd96bca861381246860 (patch) | |
tree | 78d23c1924d63ade9056a8212491960a63860960 /phpBB/phpbb/cache/driver | |
parent | 75fcfb1c1d68f1632e7beae3f59699ddff8e5292 (diff) | |
parent | 74a96bf7c2c6d4bb0c68cf74858260d0466ed3cc (diff) | |
download | forums-d26436944173d1fa28a1abd96bca861381246860.tar forums-d26436944173d1fa28a1abd96bca861381246860.tar.gz forums-d26436944173d1fa28a1abd96bca861381246860.tar.bz2 forums-d26436944173d1fa28a1abd96bca861381246860.tar.xz forums-d26436944173d1fa28a1abd96bca861381246860.zip |
Merge pull request #2460 from Nicofuma/ticket/11224
[ticket/11224] SQL cache destroy does not destroy queries to tables joined
Diffstat (limited to 'phpBB/phpbb/cache/driver')
-rw-r--r-- | phpBB/phpbb/cache/driver/memory.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index 56308be8da..0b0e323e3d 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -208,12 +208,24 @@ abstract class memory extends \phpbb\cache\driver\base // determine which tables this query belongs to // Some queries use backticks, namely the get_database_size() query // don't check for conformity, the SQL would error and not reach here. - if (!preg_match('/FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?/', $query, $regs)) + if (!preg_match_all('/(?:FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?)|(?:JOIN (`?\\w+`?(?: \\w+)?))/', $query, $regs, PREG_SET_ORDER)) { // Bail out if the match fails. return $query_result; } - $tables = array_map('trim', explode(',', $regs[1])); + + $tables = array(); + foreach ($regs as $match) + { + if ($match[0][0] == 'F') + { + $tables = array_merge($tables, array_map('trim', explode(',', $match[1]))); + } + else + { + $tables[] = $match[2]; + } + } foreach ($tables as $table_name) { |