From a47e66a6a637b23f02eed48c132968d6ff7a33aa Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Wed, 9 Nov 2011 18:42:37 +0000 Subject: [PATCH] Added wrapper function for mysql_real_escape_string --- src/messenger/webim/libs/common.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index 46f43cea..dbe9e24c 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -371,6 +371,14 @@ function close_connection($link) } } +function db_escape_string($string, $link = NULL) +{ + if ( is_null($link) ) { + return mysql_real_escape_string($string); + } + return mysql_real_escape_string($string, $link); +} + function perform_query($query, $link) { mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link));