[TEP-COMMIT] CVS: catalog/catalog/includes/functions database.php,1.21,1.22
Harald Ponce de Leon <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tep/catalog/catalog/includes/functions
In directory sc8-pr-cvs1:/tmp/cvs-serv20819/includes/functions
Modified Files:
database.php
Log Message:
use mysql_real_escape_string() or mysql_escape_string() where available
Index: database.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/functions/database.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- database.php 9 Jun 2003 21:21:59 -0000 1.21
+++ database.php 28 Dec 2003 22:29:13 -0000 1.22
@@ -123,7 +123,15 @@
return htmlspecialchars($string);
}
- function tep_db_input($string) {
+ function tep_db_input($string, $link = 'db_link') {
+ global $$link;
+
+ if (function_exists('mysql_real_escape_string')) {
+ return mysql_real_escape_string($string, $$link);
+ } elseif (function_exists('mysql_escape_string')) {
+ return mysql_escape_string($string);
+ }
+
return addslashes($string);
}
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click