[geeklog-cvs] geeklog: COM_stripslashes will now handle arrays (bug #0001413)
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Tue Jan 3 10:33:45 EST 2012
changeset 8469:8d5512a879ac
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/8d5512a879ac
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 804d0be33d0b -r 8d5512a879ac public_html/lib-common.php
--- a/public_html/lib-common.php Mon Jan 02 13:34:24 2012 -0500
+++ b/public_html/lib-common.php Tue Jan 03 10:24:32 2012 -0500
@@ -5821,14 +5821,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