summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/aur.inc.php')
-rw-r--r--web/lib/aur.inc.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php
index e4e1cb57..ed0920f9 100644
--- a/web/lib/aur.inc.php
+++ b/web/lib/aur.inc.php
@@ -229,6 +229,11 @@ function db_escape_string($string) {
return mysql_real_escape_string($string);
}
+# Escape strings for usage in SQL LIKE operators.
+function db_escape_like($string) {
+ return addcslashes(mysql_real_escape_string($string), '%_');
+}
+
# disconnect from the database
# this won't normally be needed as PHP/reference counting will take care of
# closing the connection once it is no longer referenced