From: Peter Haight Date: Sat, 6 Sep 2014 20:14:09 +0000 (-0700) Subject: mysql_escape_string is deprecated in PHP 5.5 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0d480e0fa608245bc7041c93ad99e4f1cb2db13f;p=civicrm-core.git mysql_escape_string is deprecated in PHP 5.5 This gets rid of a deprecation warning which is erroring some tests. --- diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index 2328e89a40..7d0bcd2082 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -225,7 +225,7 @@ class CRM_Core_I18n { // in such cases we return early, only doing SQL/JS escaping if (isset($params['skip']) and $params['skip']) { if (isset($escape) and ($escape == 'sql')) { - $text = mysql_escape_string($text); + $text = mysql_real_escape_string($text); } if (isset($escape) and ($escape == 'js')) { $text = addcslashes($text, "'"); @@ -322,7 +322,7 @@ class CRM_Core_I18n { // escape SQL if we were asked for it if (isset($escape) and ($escape == 'sql')) { - $text = mysql_escape_string($text); + $text = mysql_real_escape_string($text); } // escape for JavaScript (if requested)