[geeklog-cvs] geeklog: Fixed problem with backslashes appearing in the story t...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Feb 7 10:08:57 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6b5facf000ee
changeset: 6766:6b5facf000ee
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Feb 07 15:59:21 2009 +0100
description:
Fixed problem with backslashes appearing in the story title when previewing with magic_quotes_gpc = On (bug #0000790)

diffstat:

1 file changed, 11 insertions(+), 2 deletions(-)
public_html/admin/story.php |   13 +++++++++++--

diffs (23 lines):

diff -r 13f6803831ed -r 6b5facf000ee public_html/admin/story.php
--- a/public_html/admin/story.php	Mon Feb 02 09:41:18 2009 +0100
+++ b/public_html/admin/story.php	Sat Feb 07 15:59:21 2009 +0100
@@ -258,8 +258,17 @@
     }
 
     $story = new Story();
-    if($mode == 'preview')
-    {
+    if ($mode == 'preview') {
+        // Handle Magic GPC Garbage:
+        while (list($key, $value) = each($_POST)) {
+            if (!is_array($value)) {
+                $_POST[$key] = COM_stripslashes($value);
+            } else {
+                while (list($subkey, $subvalue) = each($value)) {
+                    $value[$subkey] = COM_stripslashes($subvalue);
+                }
+            }
+        }
         $result = $story->loadFromArgsArray($_POST);
     } else {
         $result = $story->loadFromDatabase($sid, $mode);



More information about the geeklog-cvs mailing list