Marius Cramer
2014-08-25 f986a3c5d914c5cfd62b61366202026331f75d0a
- another regexp fix for sql injection detection
1 files modified
3 ■■■■ changed files
interface/lib/classes/db_mysql.inc.php 3 ●●●● patch | view | raw | blame | history
interface/lib/classes/db_mysql.inc.php
@@ -138,7 +138,8 @@
                $chars = array(';', '#', '/*', '*/', '--', ' UNION ', '\\\'', '\\"');
        
                $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) {