]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
scrub magic quotes from HTML in TinyMCE
authorEvan Prodromou <evan@status.net>
Thu, 11 Mar 2010 16:54:04 +0000 (11:54 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 21 Mar 2010 22:41:37 +0000 (17:41 -0500)
plugins/TinyMCE/TinyMCEPlugin.php

index c0fd8506ed704c85d9b96bb264ee90bf6242a482..f8d85c1ba03c78ee0cc08e93937a159e7b7dee3a 100644 (file)
@@ -85,7 +85,7 @@ class TinyMCEPlugin extends Plugin
             return true;
         }
 
-        $raw = $args['status_textarea'];
+        $raw = $this->_scrub($args['status_textarea']);
 
         require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
 
@@ -127,5 +127,15 @@ END_OF_SCRIPT;
 
         return $scr;
     }
+
+    function _scrub($txt)
+    {
+        $strip = get_magic_quotes_gpc();
+        if ($strip) {
+            return stripslashes($txt);
+        } else {
+            return $txt;
+        }
+    }
 }