aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2006-07-21 13:44:22 +0000
committernikrou <nikrou@piwigo.org>2006-07-21 13:44:22 +0000
commitde1ff24582c161cab972cb455355c91ee3e8222a (patch)
tree8fe8c1e44e4f3df749513b59d8f31749e440a8b3 /include/functions.inc.php
parentd44aa8a1ed1397ba6364ea3f75aeece4a7b61cb3 (diff)
bug 471 fixed: quote in tags
git-svn-id: http://piwigo.org/svn/trunk@1487 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 970f80786..dae437a0d 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -460,6 +460,40 @@ function format_date($date, $type = 'us', $show_time = false)
return $formated_date;
}
+function pwg_stripslashes($value)
+{
+ if (get_magic_quotes_gpc())
+ {
+ $value = stripslashes($value);
+ }
+ return $value;
+}
+
+function pwg_addslashes($value)
+{
+ if (!get_magic_quotes_gpc())
+ {
+ $value = addslashes($value);
+ }
+ return $value;
+}
+
+function pwg_quotemeta($value)
+{
+ if (get_magic_quotes_gpc()) {
+ $value = stripslashes($value);
+ }
+ if (function_exists('mysql_real_escape_string'))
+ {
+ $value = mysql_real_escape_string($value);
+ }
+ else
+ {
+ $value = mysql_escape_string($value);
+ }
+ return $value;
+}
+
function pwg_query($query)
{
global $conf,$page,$debug,$t2;