From 5de1ce81e51bb6c1b9a4c573132eb223748daf06 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Fri, 05 Sep 2014 08:23:31 -0400
Subject: [PATCH] auto create / update dns-records for dkim-handling

---
 interface/lib/classes/db_mysql.inc.php |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php
index b18d583..ee159fa 100644
--- a/interface/lib/classes/db_mysql.inc.php
+++ b/interface/lib/classes/db_mysql.inc.php
@@ -126,7 +126,8 @@
 
 				if($iPos2 !== false && ($iPos === false || $iPos2 <= $iPos)) {
 					$sTxt = $this->escape($sValue);
-
+					
+					$sTxt = str_replace('`', '', $sTxt);
 					if(strpos($sTxt, '.') !== false) $sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt);
 					else $sTxt = '`' . $sTxt . '`';
 
@@ -264,11 +265,11 @@
 	}
 
 	public function queryOne($sQuery = '') {
-		return $this->query_one($sQuery);
+		return call_user_func_array(array(&$this, 'queryOneRecord'), func_get_args());
 	}
 
 	public function query_one($sQuery = '') {
-		return $this->queryOneRecord($sQuery);
+		return call_user_func_array(array(&$this, 'queryOneRecord'), func_get_args());
 	}
 
 	/**
@@ -297,11 +298,11 @@
 	}
 
 	public function queryAll($sQuery = '') {
-		return $this->queryAllRecords($sQuery);
+		return call_user_func_array(array(&$this, 'queryAllRecords'), func_get_args());
 	}
 
 	public function query_all($sQuery = '') {
-		return $this->queryAllRecords($sQuery);
+		return call_user_func_array(array(&$this, 'queryAllRecords'), func_get_args());
 	}
 
 	/**
@@ -383,7 +384,7 @@
 		global $app;
 		if(!is_string($sString) && !is_numeric($sString)) {
 			$app->log('NON-String given in escape function! (' . gettype($sString) . ')', LOGLEVEL_INFO);
-			$sAddMsg = getDebugBacktrace();
+			//$sAddMsg = getDebugBacktrace();
 			$app->log($sAddMsg, LOGLEVEL_DEBUG);
 			$sString = '';
 		}
@@ -414,12 +415,12 @@
 		$mysql_error = (is_object($this->_iConnId) ? mysqli_error($this->_iConnId) : mysqli_connect_error());
 		$mysql_errno = (is_object($this->_iConnId) ? mysqli_errno($this->_iConnId) : mysqli_connect_errno());
 
-		$sAddMsg .= getDebugBacktrace();
+		//$sAddMsg .= getDebugBacktrace();
 
 		if($this->show_error_messages && $conf['demo_mode'] === false) {
 			echo $sErrormsg . $sAddMsg;
 		} else if(is_object($app) && method_exists($app, 'log')) {
-				$app->log($sErrormsg . $sAddMsg, LOGLEVEL_WARN);
+				$app->log($sErrormsg . $sAddMsg . ' -> ' . $mysql_errno . ' (' . $mysql_error . ')', LOGLEVEL_WARN);
 			}
 	}
 
@@ -861,6 +862,9 @@
 		case 'blob':
 			return 'blob';
 			break;
+		case 'date':
+			return 'date';
+			break;
 		}
 	}
 

--
Gitblit v1.9.1