[geeklog-hg] geeklog: COM_stripslashes will now handle arrays (bug #0001413)

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Dec 22 05:12:08 EST 2012


changeset 8891:37211d8b0566
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/37211d8b0566
user: Tom <websitemaster at cogeco.net>
date: Tue Jan 03 10:24:32 2012 -0500
description:
COM_stripslashes will now handle arrays (bug #0001413)

diffstat:

 public_html/lib-common.php |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (27 lines):

diff -r e4b507626f29 -r 37211d8b0566 public_html/lib-common.php
--- a/public_html/lib-common.php	Sat Dec 24 09:30:00 2011 -0500
+++ b/public_html/lib-common.php	Tue Jan 03 10:24:32 2012 -0500
@@ -5733,14 +5733,16 @@
 * @param   string  $text  The text
 * @return  string  The text, possibly without slashes.
 */
-function COM_stripslashes( $text )
+function COM_stripslashes($text)
 {
-    if( @get_magic_quotes_gpc() == 1 )
-    {
-        return( stripslashes( $text ));
-    }
-
-    return( $text );
+    if (@get_magic_quotes_gpc() == 1) {
+        if (is_array($text)) {
+            return(array_map('stripslashes', $text));
+        } else {
+            return(stripslashes($text));
+        }
+    }
+    return($text);
 }
 
 /**



More information about the geeklog-cvs mailing list