aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-10 16:58:11 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-10 17:03:09 +0200
commitc5a4ad3d31047f9580b19b3401ef523b0fd53733 (patch)
tree57210bb8e0b10b8d9eb39c033eea549796bcd50d /phpBB/phpbb
parentd4fc060bcd61228fdf78da4f2d290a7a17546c46 (diff)
downloadforums-c5a4ad3d31047f9580b19b3401ef523b0fd53733.tar
forums-c5a4ad3d31047f9580b19b3401ef523b0fd53733.tar.gz
forums-c5a4ad3d31047f9580b19b3401ef523b0fd53733.tar.bz2
forums-c5a4ad3d31047f9580b19b3401ef523b0fd53733.tar.xz
forums-c5a4ad3d31047f9580b19b3401ef523b0fd53733.zip
[ticket/10899] Using Delete All in log viewer with keyword search
https://tracker.phpbb.com/browse/PHPBB3-10899 PHPBB3-10899
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/log/log.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index e4c5ce47d9..e3a0fa0261 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -636,11 +636,12 @@ class log implements \phpbb\log\log_interface
/**
* Generates a sql condition for the specified keywords
*
- * @param string $keywords The keywords the user specified to search for
+ * @param string $keywords The keywords the user specified to search for
+ * @param string $table_alias The alias of the logs' table ('l.' by default)
*
* @return string Returns the SQL condition searching for the keywords
*/
- protected function generate_sql_keyword($keywords)
+ public function generate_sql_keyword($keywords, $table_alias = 'l.')
{
// Use no preg_quote for $keywords because this would lead to sole
// backslashes being added. We also use an OR connection here for
@@ -688,9 +689,9 @@ class log implements \phpbb\log\log_interface
$sql_keywords = 'AND (';
if (!empty($operations))
{
- $sql_keywords .= $this->db->sql_in_set('l.log_operation', $operations) . ' OR ';
+ $sql_keywords .= $this->db->sql_in_set($table_alias . 'log_operation', $operations) . ' OR ';
}
- $sql_lower = $this->db->sql_lower_text('l.log_data');
+ $sql_lower = $this->db->sql_lower_text($table_alias . 'log_data');
$sql_keywords .= " $sql_lower " . implode(" OR $sql_lower ", $keywords) . ')';
}