From d2e324fe0bfd7ee20609453c873516682b914959 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 7 Jan 2003 14:37:50 +0000 Subject: [PATCH] Move escape functions to DB methods git-svn-id: file:///svn/phpbb/trunk@3264 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/db/mssql.php | 10 ++++++++++ phpBB/db/mysql4.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/phpBB/db/mssql.php b/phpBB/db/mssql.php index a6634f6a86..6cf118b22a 100644 --- a/phpBB/db/mssql.php +++ b/phpBB/db/mssql.php @@ -403,6 +403,16 @@ class sql_db return ( $query_id ) ? mssql_free_result($query_id) : false; } + function sql_quote($sql) + { + return str_replace("\'", "''", $sql); + } + + function sql_escape($sql) + { + return str_replace("'", "''", str_replace('\\', '\\\\', $sql)); + } + function sql_error($query_id = 0) { $result['message'] = @mssql_get_last_message(); diff --git a/phpBB/db/mysql4.php b/phpBB/db/mysql4.php index 6c1b027697..d6f00ed1d6 100644 --- a/phpBB/db/mysql4.php +++ b/phpBB/db/mysql4.php @@ -379,6 +379,16 @@ if (!empty($_REQUEST['explain'])) return ( $query_id ) ? @mysql_free_result($query_id) : false; } + function sql_quote($msg) + { + return mysql_escape_string($msg); + } + + function sql_escape($msg) + { + return mysql_escape_string($msg); + } + function sql_error($sql = '') { if ( !$this->return_on_error )