diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-06 23:20:50 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-06 23:20:50 +0200 |
commit | a12a7d0b9058cd3b7ca43bcea3c5a569df7b700b (patch) | |
tree | 2dd5c309fd2a516c4ada96f6bf4a54cfad9f271c /phpBB/includes | |
parent | ce0c33f62a0e34a733b9da57cb41f4bf573740c2 (diff) | |
parent | 74a96bf7c2c6d4bb0c68cf74858260d0466ed3cc (diff) | |
download | forums-a12a7d0b9058cd3b7ca43bcea3c5a569df7b700b.tar forums-a12a7d0b9058cd3b7ca43bcea3c5a569df7b700b.tar.gz forums-a12a7d0b9058cd3b7ca43bcea3c5a569df7b700b.tar.bz2 forums-a12a7d0b9058cd3b7ca43bcea3c5a569df7b700b.tar.xz forums-a12a7d0b9058cd3b7ca43bcea3c5a569df7b700b.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/includes')
-rw-r--r-- | phpBB/includes/acm/acm_memory.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/includes/acm/acm_memory.php b/phpBB/includes/acm/acm_memory.php index 2936ea0bae..9b68585d24 100644 --- a/phpBB/includes/acm/acm_memory.php +++ b/phpBB/includes/acm/acm_memory.php @@ -292,12 +292,24 @@ class acm_memory // 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; } - $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) { |