* Bidi-aid on list pages
* (bug 5782) Allow entries in the bad image list to use canonical namespace names
* (bug 5789) Treat "loginreqpagetext" as wikitext
+* Sanitizer: now handles nested <li> in <ul> or <ol>
== Compatibility ==
'dl', 'font', 'big', 'small', 'sub', 'sup', 'span'
);
$tabletags = array( # Can only appear inside table
- 'td', 'th', 'tr'
+ 'td', 'th', 'tr',
);
+ $htmllist = array( # Tags used by list
+ 'ul','ol',
+ );
+ $listtags = array( # Tags that can appear in a list
+ 'li',
+ );
+
} else {
$htmlpairs = array();
$htmlsingle = array();
$badtag = 1;
} elseif ( ( $ot = @array_pop( $tagstack ) ) != $t ) {
@array_push( $tagstack, $ot );
- $badtag = 1;
+ # <li> can be nested in <ul> or <ol>, skip those cases:
+ if(!(in_array($ot, $htmllist) && in_array($t, $listtags) )) {
+ $badtag = 1;
+ }
} else {
if ( $t == 'table' ) {
$tagstack = array_pop( $tablestack );