|
@@ -375,20 +375,14 @@ function smf_db_query($identifier, $db_string, $db_values = array(), $connection
|
|
|
$clean .= substr($db_string, $old_pos);
|
|
|
$clean = trim(strtolower(preg_replace($allowed_comments_from, $allowed_comments_to, $clean)));
|
|
|
|
|
|
-
|
|
|
- if (strpos($clean, 'union') !== false && preg_match('~(^|[^a-z])union($|[^[a-z])~s', $clean) != 0)
|
|
|
- $fail = true;
|
|
|
|
|
|
- elseif (strpos($clean, '/*') > 2 || strpos($clean, '--') !== false || strpos($clean, ';') !== false)
|
|
|
+ if (strpos($clean, '/*') > 2 || strpos($clean, '--') !== false || strpos($clean, ';') !== false)
|
|
|
$fail = true;
|
|
|
|
|
|
elseif (strpos($clean, 'sleep') !== false && preg_match('~(^|[^a-z])sleep($|[^[_a-z])~s', $clean) != 0)
|
|
|
$fail = true;
|
|
|
elseif (strpos($clean, 'benchmark') !== false && preg_match('~(^|[^a-z])benchmark($|[^[a-z])~s', $clean) != 0)
|
|
|
$fail = true;
|
|
|
-
|
|
|
- elseif (preg_match('~\([^)]*?select~s', $clean) != 0)
|
|
|
- $fail = true;
|
|
|
|
|
|
if (!empty($fail) && function_exists('log_error'))
|
|
|
smf_db_error_backtrace('Hacking attempt...', 'Hacking attempt...' . "\n" . $db_string, E_USER_ERROR, __FILE__, __LINE__);
|