From a6daece140541c30b7b40237942e4aec7912ef1f Mon Sep 17 00:00:00 2001 From: RobbBienert Date: Tue, 5 Nov 2013 21:36:35 +0100 Subject: [PATCH] fixing https://github.com/jeena/jlog/issues/5 --- scripts/general.func.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/general.func.php b/scripts/general.func.php index 8d2b774..406ece1 100644 --- a/scripts/general.func.php +++ b/scripts/general.func.php @@ -88,8 +88,14 @@ function strip($_data) { } // escape input for mysql function escape_for_mysql($_data) { - if (is_array($_data)) foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val); - else $_data = mysql_escape_string($_data); + if (is_array($_data)) + foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val); + else + $_data = mysql_real_escape_string($_data); + // uses last opened MySQL link implicitly + // assumption is valid because this function is never called + // before mysql_connect + return $_data; } // htmlspecialchars a whole array