1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge branch 'develop-ascraeus' into develop

This commit is contained in:
Joas Schilling
2014-10-01 10:27:56 +02:00
4 changed files with 286 additions and 2 deletions

View File

@@ -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)
{