Merge "Fix spacing in SpecialRevisiondelete.php"
[lhc/web/wiklou.git] / includes / HtmlFormatter.php
index 99426ec..c06fbbc 100644 (file)
@@ -73,9 +73,11 @@ class HtmlFormatter {
                        $html = str_replace( ' <', '&#32;<', $html );
 
                        libxml_use_internal_errors( true );
+                       $loader = libxml_disable_entity_loader();
                        $this->doc = new DOMDocument();
                        $this->doc->strictErrorChecking = false;
                        $this->doc->loadHTML( $html );
+                       libxml_disable_entity_loader( $loader );
                        libxml_use_internal_errors( false );
                        $this->doc->encoding = 'UTF-8';
                }
@@ -133,6 +135,7 @@ class HtmlFormatter {
                $removals = $this->parseItemsToRemove();
 
                if ( !$removals ) {
+                       wfProfileOut( __METHOD__ );
                        return;
                }
 
@@ -303,14 +306,10 @@ class HtmlFormatter {
                } elseif ( strpos( $selector, '#' ) === 0 ) {
                        $type = 'ID';
                        $rawName = substr( $selector, 1 );
-               } elseif ( strpos( $selector, '.' ) !== 0 &&
-                       strpos( $selector, '.' ) !== false )
-               {
+               } elseif ( strpos( $selector, '.' ) !== 0 && strpos( $selector, '.' ) !== false ) {
                        $type = 'TAG_CLASS';
                        $rawName = $selector;
-               } elseif ( strpos( $selector, '[' ) === false
-                       && strpos( $selector, ']' ) === false )
-               {
+               } elseif ( strpos( $selector, '[' ) === false && strpos( $selector, ']' ) === false ) {
                        $type = 'TAG';
                        $rawName = $selector;
                } else {