X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fdb%2Flib-mysql3.php;h=735e6dd89943b4a5b34f2c81ce42d13e5d238ff1;hb=06d179ae45f3f049003e6fe213249842b2a630fe;hp=8ed21c3218340cb79142db44896e4dbb535793b6;hpb=110c8e34f37715c3394e33974f47965c24dff87e;p=mailer.git
diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php
index 8ed21c3218..735e6dd899 100644
--- a/inc/db/lib-mysql3.php
+++ b/inc/db/lib-mysql3.php
@@ -71,14 +71,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:
@@ -281,7 +285,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) {