mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
new wrapper for LIKE expressions to streamline the fixes. We actually need to adjust them for different DBMS as well as SQLite2 not supporting escaping characters in LIKE statements (which is a reason why we think about dropping sqlite support completely).
git-svn-id: file:///svn/phpbb/trunk@7788 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -966,20 +966,9 @@ class auth_admin extends auth
|
||||
if ($permission_type !== false)
|
||||
{
|
||||
// Get permission type
|
||||
if ($db->sql_layer == 'sqlite')
|
||||
{
|
||||
$sql = 'SELECT auth_option, auth_option_id
|
||||
FROM ' . ACL_OPTIONS_TABLE . "
|
||||
WHERE auth_option LIKE '" . $db->sql_escape($permission_type) . "%'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT auth_option, auth_option_id
|
||||
FROM ' . ACL_OPTIONS_TABLE . "
|
||||
WHERE auth_option LIKE '" . $db->sql_escape(str_replace('_', "\_", $permission_type)) . "%'";
|
||||
$sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
|
||||
}
|
||||
|
||||
$sql = 'SELECT auth_option, auth_option_id
|
||||
FROM ' . ACL_OPTIONS_TABLE . "
|
||||
WHERE auth_option " . $db->sql_like_expression($permission_type . '%');
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$auth_id_ary = array();
|
||||
|
Reference in New Issue
Block a user