X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdb%2Flib-mysql3.php;h=7f5a297c64642679265ab14be06f0452a9861131;hp=8ed21c3218340cb79142db44896e4dbb535793b6;hb=c544e11e6c117f1a1757bbc98b19e9675dc9b3cb;hpb=606e585919ff565b55fb3c2cdee4a80c4e61a9c6
diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php
index 8ed21c3218..7f5a297c64 100644
--- a/inc/db/lib-mysql3.php
+++ b/inc/db/lib-mysql3.php
@@ -18,6 +18,7 @@
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -71,14 +72,18 @@ function SQL_QUERY ($sqlString, $F, $L) {
// Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
$sqlString = str_replace("\t", ' ', str_replace("\n", ' ', str_replace("\r", ' ', $sqlString)));
- // Compile config out
- $sqlString = FILTER_COMPILE_CONFIG($sqlString, true);
+ // Replace {PER}
+ $sqlString = str_replace('{PER}', '%', $sqlString);
+
+ // Compile config entries out
+ $eval = "\$sqlString = \"".FILTER_COMPILE_CONFIG(escapeQuotes($sqlString))."\";";
+ eval($eval);
// Starting time
$querytimeBefore = microtime(true);
// Run SQL command
- //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . $sqlString . '
');
+ //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '
');
$result = mysql_query($sqlString, SQL_GET_LINK())
or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):' . mysql_error() . '
Query string:
@@ -101,7 +106,7 @@ Query string:
incrementConfigEntry('sql_count');
// Debug output
- if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (isConfigEntrySet('DEBUG_SQL')) && (getConfig('DEBUG_SQL') == 'Y')) {
+ if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (isSqlDebuggingEnabled())) {
//
// Debugging stuff...
//
@@ -281,7 +286,7 @@ function SQL_QUERY_ESC ($qstring, $data, $F, $L, $run=true, $strip=true, $secure
// Debugging
//
//* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
- //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
+ //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", ' ', $eval))."\n");
//* DEBUG: */ fclose($fp);
if ($run === true) {