From ebd0e986ed11f2a34fb58cdd33efbfab192083ad Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 22 Apr 2016 05:26:17 -0400
Subject: [PATCH] Added PHP 7 check in installer and updater.
---
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