aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cache.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/cache.php')
-rw-r--r--phpBB/includes/cache.php29
1 files changed, 4 insertions, 25 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
index 52e0007b28..c5445e7a56 100644
--- a/phpBB/includes/cache.php
+++ b/phpBB/includes/cache.php
@@ -295,31 +295,10 @@ class cache
{
global $db;
- switch ($db->sql_layer)
- {
- case 'mssql':
- case 'mssql_odbc':
- $sql = 'SELECT user_id, bot_agent, bot_ip
- FROM ' . BOTS_TABLE . '
- WHERE bot_active = 1
- ORDER BY LEN(bot_agent) DESC';
- break;
-
- case 'firebird':
- $sql = 'SELECT user_id, bot_agent, bot_ip
- FROM ' . BOTS_TABLE . '
- WHERE bot_active = 1
- ORDER BY CHAR_LENGTH(bot_agent) DESC';
- break;
-
- // LENGTH supported by MySQL, IBM DB2 and Oracle for sure...
- default:
- $sql = 'SELECT user_id, bot_agent, bot_ip
- FROM ' . BOTS_TABLE . '
- WHERE bot_active = 1
- ORDER BY LENGTH(bot_agent) DESC';
- break;
- }
+ $sql = 'SELECT user_id, bot_agent, bot_ip
+ FROM ' . BOTS_TABLE . '
+ WHERE bot_active = 1
+ ORDER BY ' . $db->sql_function('length_varchar', 'bot_agent') . 'DESC';
$result = $db->sql_query($sql);
$bots = array();