diff options
author | Thomas Backlund <tmb@mageia.org> | 2017-05-26 20:02:07 +0300 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2017-05-26 20:02:07 +0300 |
commit | 5e6803684739dc0963d784c0cefd86697ad397f3 (patch) | |
tree | 8ab6acff6c8069c5ba3035cba3adec90dba24ba1 /phpBB/includes/acm | |
parent | 8fc97191a3533a1cce0b051baa55db68d83b5dc4 (diff) | |
parent | 11242dd07d6359a725f22f3674028adfdddb49d6 (diff) | |
download | forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.gz forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.bz2 forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.xz forums-5e6803684739dc0963d784c0cefd86697ad397f3.zip |
Merge tag 'release-3.0.14' of https://github.com/phpbb/phpbb
Merge upstream 3.0.14 release.
Diffstat (limited to 'phpBB/includes/acm')
-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) { |