aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/cache
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-10-01 15:00:01 +0200
committerTristan Darricau <github@nicofuma.fr>2014-10-03 23:50:24 +0200
commit8e638dbf6d53be3d8c5b1eda8ce44e7e4f60b75a (patch)
tree7a92af7c477390b22f389163e73f542d2cd4fbfa /phpBB/phpbb/cache
parent40cd7570e6f4da7cc60d83a3e99c72a2fb99e3f7 (diff)
downloadforums-8e638dbf6d53be3d8c5b1eda8ce44e7e4f60b75a.tar
forums-8e638dbf6d53be3d8c5b1eda8ce44e7e4f60b75a.tar.gz
forums-8e638dbf6d53be3d8c5b1eda8ce44e7e4f60b75a.tar.bz2
forums-8e638dbf6d53be3d8c5b1eda8ce44e7e4f60b75a.tar.xz
forums-8e638dbf6d53be3d8c5b1eda8ce44e7e4f60b75a.zip
[ticket/11224] Revert Revert "Merge pull request #2460 from ticket/11224"
Diffstat (limited to 'phpBB/phpbb/cache')
-rw-r--r--phpBB/phpbb/cache/driver/memory.php16
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)
{