]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib-mysql3.php
Email templates changed, surfbar extended (dummy) with member actions
[mailer.git] / inc / db / lib-mysql3.php
index c9b5b320c19610731c1f96c21181ca1d3d8c0eea..3f26d2ce900bba950f1340c7cb8a50e1a851f4d4 100644 (file)
@@ -219,15 +219,18 @@ function SQL_FREERESULT($result) {
 // SQL string escaping
 function SQL_QUERY_ESC($qstring, $data, $file, $line, $run=true, $strip=true) {
        global $link;
+
+       if ($strip) {
+               $strip = "true";
+       } else {
+               $strip = "false";
+       }
+
        $query = "";
        $eval = "\$query = sprintf(\"".$qstring."\"";
        foreach ($data as $var) {
                if ((!empty($var)) || ($var === 0)) {
-                       if ($strip) {
-                               $eval .= ", SQL_ESCAPE(\"".strip_tags($var)."\")";
-                       } else {
-                               $eval .= ", SQL_ESCAPE(\"".$var."\")";
-                       }
+                       $eval .= ", SQL_ESCAPE(\"".$var."\",true,".$strip.")";
                } else {
                        $eval .= ", ''";
                }
@@ -240,11 +243,14 @@ function SQL_QUERY_ESC($qstring, $data, $file, $line, $run=true, $strip=true) {
        //fwrite($fp, $file."(".$line."): ".str_replace("\r", "", str_replace("\n", " ", $eval))."\n");
        //fclose($fp);
        @eval($eval);
+       // Was the eval() command fine?
        if (empty($query)) {
+               // Something went wrong?
                print "eval=".htmlentities($eval)."<pre>";
                debug_print_backtrace();
                die("</pre>");
-       }
+       } // END - if
+
        if ($run) {
                // Run SQL query (default)
                return SQL_QUERY($query, $file, $line);
@@ -258,13 +264,13 @@ function SQL_INSERTID() {
        return @mysql_insert_id();
 }
 // Escape a string for the database
-function SQL_ESCAPE($str, $secureString = true) {
+function SQL_ESCAPE($str, $secureString=true,$strip=true) {
        global $link;
 
        // Secure string first? (which is the default behaviour!)
        if ($secureString) {
                // Then do it here
-               $str = secureString($str);
+               $str = secureString($str, $strip);
        } // END - if
 
        if (!is_resource($link)) {