diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-05-14 19:56:19 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-05-14 20:00:04 +0200 |
commit | 0c109c9d377e10757c208c1d87aa6d4bf8d9af44 (patch) | |
tree | 514efc5d9bba2fbcc90264ab1ea57122229bfa9d /phpBB/includes | |
parent | cc0446dc17aeb3639b374a6688e32fca271e0694 (diff) | |
download | forums-0c109c9d377e10757c208c1d87aa6d4bf8d9af44.tar forums-0c109c9d377e10757c208c1d87aa6d4bf8d9af44.tar.gz forums-0c109c9d377e10757c208c1d87aa6d4bf8d9af44.tar.bz2 forums-0c109c9d377e10757c208c1d87aa6d4bf8d9af44.tar.xz forums-0c109c9d377e10757c208c1d87aa6d4bf8d9af44.zip |
[ticket/11224] SQL cache destroy does not destroy queries to tables joined
https://tracker.phpbb.com/browse/PHPBB3-11224
PHPBB3-11224
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acm/acm_memory.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/phpBB/includes/acm/acm_memory.php b/phpBB/includes/acm/acm_memory.php index 2936ea0bae..d975e4b348 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; + return $query_result; + } + + $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]; + } } - $tables = array_map('trim', explode(',', $regs[1])); foreach ($tables as $table_name) { |