X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftidy%2FBalancer.php;h=6671f49ba7d065eeffa493776d7b78aac8c5a22c;hb=f9ad69d2a5312b0565a5b1a3762aa812f6b5cfb9;hp=e57063377877d221c107f0a067c3705ec9d1e497;hpb=d26f3a3232f769803bec779735b21dcda5fdacc7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/tidy/Balancer.php b/includes/tidy/Balancer.php index e570633778..6671f49ba7 100644 --- a/includes/tidy/Balancer.php +++ b/includes/tidy/Balancer.php @@ -23,14 +23,15 @@ * @since 1.27 * @author C. Scott Ananian, 2016 */ + namespace MediaWiki\Tidy; +use ExplodeIterator; +use IteratorAggregate; +use ReverseArrayIterator; +use Sanitizer; use Wikimedia\Assert\Assert; use Wikimedia\Assert\ParameterAssertionException; -use \ExplodeIterator; -use \IteratorAggregate; -use \ReverseArrayIterator; -use \Sanitizer; // A note for future librarization[1] -- this file is a good candidate // for splitting into an independent library, except that it is currently @@ -293,6 +294,9 @@ class BalanceSets { 'span' => true, 'strike' => true, 'strong' => true, 'sub' => true, 'sup' => true, 'textarea' => true, 'tt' => true, 'u' => true, 'var' => true, + // Those defined in tidy.conf + 'video' => true, 'audio' => true, 'bdi' => true, 'data' => true, + 'time' => true, 'mark' => true, ], ]; } @@ -1365,7 +1369,7 @@ class BalanceStack implements IteratorAggregate { foreach ( $this->elements as $elt ) { array_push( $r, $elt->localName ); } - return implode( $r, ' ' ); + return implode( ' ', $r ); } } @@ -1903,7 +1907,7 @@ class Balancer { } ); if ( count( $bad ) > 0 ) { - $badstr = implode( array_keys( $bad ), ',' ); + $badstr = implode( ',', array_keys( $bad ) ); throw new ParameterAssertionException( '$config', 'Balance attempted with sanitization including ' .