Sanitizer: Remove redundant @private tags
[lhc/web/wiklou.git] / includes / Sanitizer.php
index f3a5281..499d821 100644 (file)
@@ -54,7 +54,6 @@ class Sanitizer {
         * List of all named character entities defined in HTML 4.01
         * http://www.w3.org/TR/html4/sgml/entities.html
         * As well as ' which is only defined starting in XHTML1.
-        * @private
         */
        private static $htmlEntities = array(
                'Aacute'   => 193,
@@ -322,7 +321,6 @@ class Sanitizer {
 
        /**
         * Lazy-initialised attributes regex, see getAttribsRegex()
-        * @private
         */
        private static $attribsRegex;
 
@@ -389,10 +387,10 @@ class Sanitizer {
                                'kbd', 'samp', 'data', 'time', 'mark'
                        );
                        $htmlsingle = array(
-                               'br', 'hr', 'li', 'dt', 'dd'
+                               'br', 'wbr', 'hr', 'li', 'dt', 'dd'
                        );
                        $htmlsingleonly = array( # Elements that cannot have close tags
-                               'br', 'hr'
+                               'br', 'wbr', 'hr'
                        );
                        if ( $wgAllowMicrodataAttributes ) {
                                $htmlsingle[] = $htmlsingleonly[] = 'meta';
@@ -448,7 +446,7 @@ class Sanitizer {
                                # $params: String between element name and >
                                # $brace: Ending '>' or '/>'
                                # $rest: Everything until the next element of $bits
-                               if ( preg_match( '!^(/?)(\\w+)([^>]*?)(/{0,1}>)([^<]*)$!', $x, $regs ) ) {
+                               if ( preg_match( '!^(/?)([^\\s/>]+)([^>]*?)(/{0,1}>)([^<]*)$!', $x, $regs ) ) {
                                        list( /* $qbar */, $slash, $t, $params, $brace, $rest ) = $regs;
                                } else {
                                        $slash = $t = $params = $brace = $rest = null;
@@ -1548,6 +1546,9 @@ class Sanitizer {
                        # 9.3.2
                        'br'         => array( 'id', 'class', 'title', 'style', 'clear' ),
 
+                       # http://www.whatwg.org/html/text-level-semantics.html#the-wbr-element
+                       'wbr'        => array( 'id', 'class', 'title', 'style' ),
+
                        # 9.3.4
                        'pre'        => array_merge( $common, array( 'width' ) ),
 
@@ -1799,6 +1800,6 @@ class Sanitizer {
                $                      # End of string
                /ix"; // case Insensitive, eXtended
 
-               return (bool) preg_match( $HTML5_email_regexp, $addr );
+               return (bool)preg_match( $HTML5_email_regexp, $addr );
        }
 }