]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Blog/classes/Blog_entry.php
use common_purify to purify HTML, one function to rule them all
[quix0rs-gnu-social.git] / plugins / Blog / classes / Blog_entry.php
index 1f585dce4ff854c15b5b1c5ac8d0f7cebbd89671..6b82a0fdd12751e0885a5045897b7caaf86d78de 100644 (file)
@@ -117,10 +117,10 @@ class Blog_entry extends Managed_DataObject
         $be->id         = (string) new UUID();
         $be->profile_id = $profile->id;
         $be->title      = $title; // Note: not HTML-protected
-        $be->content    = self::purify($content);
+        $be->content    = common_purify($content);
 
         if (array_key_exists('summary', $options)) {
-            $be->summary = self::purify($options['summary']);
+            $be->summary = common_purify($options['summary']);
         } else {
             // Already purified
             $be->summary = self::summarize($be->content);
@@ -241,18 +241,4 @@ class Blog_entry extends Managed_DataObject
 
         return $obj;
     }
-
-    /**
-     * Clean up input HTML
-     */
-    static function purify($html)
-    {
-        require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
-
-        $config = array('safe' => 1,
-                        'deny_attribute' => 'id,style,on*');
-        $pure = htmLawed($html, $config);
-
-        return $pure;
-    }
 }