From d907c0ce889a71b1ac5fb49e8dd5229b9459bd0e Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Thu, 06 Nov 2014 12:23:24 -0500 Subject: [PATCH] Fix for gentoo: http://www.howtoforge.com/forums/showpost.php?p=321184&postcount=10 --- interface/lib/classes/db_mysql.inc.php | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index 6609ec9..7331463 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -132,13 +132,19 @@ if($ids_config['sql_scan_enabled'] == 'yes') { + // Remove whitespace + $string = trim($string); + if(substr($string,-1) == ';') $string = substr($string,0,-1); + + // Save original string $string_orig = $string; //echo $string; - $chars = array(';', '#', '/*', '*/', '--', ' UNION ', '\\\'', '\\"'); + $chars = array(';', '#', '/*', '*/', '--', '\\\'', '\\"'); $string = str_replace('\\\\', '', $string); - $string = preg_replace('/(^|[^\\\])([\'"])(.*?[^\\\]?)\\2/is', '$1', $string); + $string = preg_replace('/(^|[^\\\])([\'"])\\2/is', '$1', $string); + $string = preg_replace('/(^|[^\\\])([\'"])(.*?[^\\\])\\2/is', '$1', $string); $ok = true; if(substr_count($string, "`") % 2 != 0 || substr_count($string, "'") % 2 != 0 || substr_count($string, '"') % 2 != 0) { -- Gitblit v1.9.1