From d6bec7a7dba66e8312305eb50bdad73299c533e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 30 Jun 2015 06:28:48 -0400
Subject: [PATCH] - fixed access check in client templates and mail content filters
---
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