瀏覽代碼

Remove the automatic null for empty string in the check_sql function

Mark Crane 11 年之前
父節點
當前提交
68579291a2
共有 1 個文件被更改,包括 1 次插入10 次删除
  1. 1 10
      resources/functions.php

+ 1 - 10
resources/functions.php

@@ -62,16 +62,7 @@
 
 
 	if (!function_exists('check_sql')) {
 	if (!function_exists('check_sql')) {
 		function check_sql($string) {
 		function check_sql($string) {
-			// if insert statement
-			if (strpos(strtolower(trim($string)), "insert") == 0) {
-				$string = str_replace(" ''", " null", $string);
-				$string = str_replace(",''", ",null", $string);
-				$string = str_replace("'',", "null,", $string);
-				$string = str_replace("(''", "(null", $string);
-				$string = str_replace("'')", "null)", $string);
-				$string = str_replace("'' )", "null )", $string);
-			}
-			return trim($string); //remove white space  ADD TRIM BACK IN!
+			return trim($string); //remove white space
 		}
 		}
 	}
 	}