[ticket/12639] Handle $conditions['keywords'] outside of the loop

PHPBB3-12639
This commit is contained in:
Tristan Darricau 2014-06-02 23:35:35 +02:00
parent 3e31764007
commit f980fed5d2

View file

@ -391,13 +391,15 @@ class log implements \phpbb\log\log_interface
}
$sql_where = 'WHERE log_type = ' . $log_type;
foreach ($conditions as $field => $field_value)
if (isset($conditions['keywords']))
{
if ($field == 'keywords')
{
$sql_where .= $this->generate_sql_keyword($field_value, '', ' AND');
$sql_where .= $this->generate_sql_keyword($conditions['keywords'], '', ' AND');
unset($conditions['keywords']);
}
else
foreach ($conditions as $field => $field_value)
{
$sql_where .= ' AND ';
@ -414,7 +416,6 @@ class log implements \phpbb\log\log_interface
$sql_where .= $field . ' = ' . $field_value;
}
}
}
$sql = 'DELETE FROM ' . LOG_TABLE . "
$sql_where";