]> git.mjollnir.org Git - s9y.git/commitdiff
Let xhtmlclean also clean iframe. Thanks to karotte.
authorgarvinhicking <garvinhicking>
Wed, 7 Sep 2005 13:18:49 +0000 (13:18 +0000)
committergarvinhicking <garvinhicking>
Wed, 7 Sep 2005 13:18:49 +0000 (13:18 +0000)
plugins/serendipity_event_xhtmlcleanup/serendipity_event_xhtmlcleanup.php

index a9719a5a7107836c2d63286323b512f541cac4d1..39df9154fa13ece4f447dfcfdb97b2f9c4220a19 100644 (file)
@@ -35,7 +35,7 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
         $propbag->add('description',   PLUGIN_EVENT_XHTMLCLEANUP_DESC);
         $propbag->add('stackable',     false);
         $propbag->add('author',        'Garvin Hicking');
-        $propbag->add('version',       '1.2');
+        $propbag->add('version',       '1.3');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -120,7 +120,7 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
                             // Basic cleanup (core s9y functionality)
                             $eventData[$element]    = xhtml_cleanup($eventData[$element]);
                             $eventData[$element]    = preg_replace_callback('@(<img.+/?>)@imsU', array($this, 'clean_tag'), $eventData[$element]);
-                            $eventData[$element]    = preg_replace_callback("@<a(.*)href=(\"|')([^\"']+)(\"|')@isUm", array($this, 'clean_htmlspecialchars'), $eventData[$element]);
+                            $eventData[$element]    = preg_replace_callback("@<(a|iframe)(.*)(href|src)=(\"|')([^\"']+)(\"|')@isUm", array($this, 'clean_htmlspecialchars'), $eventData[$element]);
                         }
                     }
 
@@ -172,7 +172,7 @@ class serendipity_event_xhtmlcleanup extends serendipity_event
     }
 
     function clean_htmlspecialchars($given, $quote_style = ENT_QUOTES) {
-        return '<a' . $given[1] . 'href=' . $given[2] . htmlspecialchars(html_entity_decode($given[3], $quote_style), $quote_style) . $given[4];
+        return '<' . $given[1] . $given[2] . $given[3] . '=' . $given[4] . htmlspecialchars(html_entity_decode($given[5], $quote_style), $quote_style) . $given[6];
     }
 }