Index: includes/Parser.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/Parser.php,v
retrieving revision 1.602
diff -c -r1.602 Parser.php
*** includes/Parser.php 22 Mar 2006 04:57:14 -0000 1.602
--- includes/Parser.php 24 Mar 2006 14:52:21 -0000
***************
*** 303,324 ****
}
if( $tag == STRIP_COMMENTS ) {
! $start = '//';
} else {
! $start = "/<$tag(\\s+[^\\/>]*|\\s*)(\\/?)>/i";
$end = "/<\\/$tag\\s*>/i";
}
!
while ( '' != $text ) {
$p = preg_split( $start, $text, 2, PREG_SPLIT_DELIM_CAPTURE );
$stripped .= $p[0];
! if( count( $p ) < 4 ) {
break;
}
$attributes = $p[1];
! $empty = $p[2];
! $inside = $p[3];
$marker = $rnd . sprintf('%08X', $n++);
$stripped .= $marker;
--- 303,332 ----
}
if( $tag == STRIP_COMMENTS ) {
! $start = '//';
} else {
! $start = "/<$tag(\\s+[^>]*|\\s*\/?)>/i";
$end = "/<\\/$tag\\s*>/i";
}
!
while ( '' != $text ) {
$p = preg_split( $start, $text, 2, PREG_SPLIT_DELIM_CAPTURE );
$stripped .= $p[0];
! if( count( $p ) < 3 ) {
break;
}
$attributes = $p[1];
! $inside = $p[2];
!
! // If $attributes ends with '/', we have an empty element tag,
+ string(0) "" + array(1) { + ["filename"]=> + string(8) "/tmp/bla" + } ++ + !! end + + !! test Parser hook: empty input using terminated empty elements (bug 2374) !! input