From dc19c4eb8c75b5ec02d2d5337b7fb63c8b61688e Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 16 Feb 2014 06:27:35 -0500
Subject: [PATCH] Fixed: FS#3093 - PHPMyAdmin URL field does not accept uri symbols '?', '&' and '='

---
 interface/lib/classes/db_mysql.inc.php |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php
index 1636cab..12b3b42 100644
--- a/interface/lib/classes/db_mysql.inc.php
+++ b/interface/lib/classes/db_mysql.inc.php
@@ -284,7 +284,7 @@
 		// Insert the server_id, if the record has a server_id
 		$server_id = (isset($record_old['server_id']) && $record_old['server_id'] > 0)?$record_old['server_id']:0;
 		if(isset($record_new['server_id'])) $server_id = $record_new['server_id'];
-
+		$server_id = intval($server_id);
 
 		if($diff_num > 0) {
 			//print_r($diff_num);
@@ -306,6 +306,9 @@
 	//** Inserts a record and saves the changes into the datalog
 	public function datalogInsert($tablename, $insert_data, $index_field) {
 		global $app;
+		
+		$tablename = $this->quote($tablename);
+		$index_field = $this->quote($index_field);
 
 		if(is_array($insert_data)) {
 			$key_str = '';
@@ -333,6 +336,10 @@
 	//** Updates a record and saves the changes into the datalog
 	public function datalogUpdate($tablename, $update_data, $index_field, $index_value, $force_update = false) {
 		global $app;
+		
+		$tablename = $this->quote($tablename);
+		$index_field = $this->quote($index_field);
+		$index_value = $this->quote($index_value);
 
 		$old_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
 
@@ -356,6 +363,10 @@
 	//** Deletes a record and saves the changes into the datalog
 	public function datalogDelete($tablename, $index_field, $index_value) {
 		global $app;
+		
+		$tablename = $this->quote($tablename);
+		$index_field = $this->quote($index_field);
+		$index_value = $this->quote($index_value);
 
 		$old_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
 		$this->query("DELETE FROM $tablename WHERE $index_field = '$index_value'");
@@ -653,6 +664,9 @@
 		case 'blob':
 			return 'blob';
 			break;
+		case 'date':
+			return 'date';
+			break;
 		}
 	}
 

--
Gitblit v1.9.1