diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-06 23:21:13 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-06 23:21:13 +0200 |
commit | f3eaf6fe04dc9edf43dc0298d97d6242d1472f00 (patch) | |
tree | 59722eb2bfe11abdd1e18ea586d13fc02af0f919 /phpBB/phpbb/cache | |
parent | 7479c61d0596e9730a73ebb71eccc9ddbded8542 (diff) | |
parent | 5354c46e01a1efd65d4b53af12173ef4947eec9c (diff) | |
download | forums-f3eaf6fe04dc9edf43dc0298d97d6242d1472f00.tar forums-f3eaf6fe04dc9edf43dc0298d97d6242d1472f00.tar.gz forums-f3eaf6fe04dc9edf43dc0298d97d6242d1472f00.tar.bz2 forums-f3eaf6fe04dc9edf43dc0298d97d6242d1472f00.tar.xz forums-f3eaf6fe04dc9edf43dc0298d97d6242d1472f00.zip |
Merge pull request #3016 from Nicofuma/ticket/11224-ascraeus
[ticket/11224][ascraeus] SQL cache destroy does not destroy queries to tables joined
Diffstat (limited to 'phpBB/phpbb/cache')
-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) { |