https://bugzilla.wikimedia.org/show_bug.cgi?id=26731

           Summary: Parser->serialiseHalfParsedText($text) does not save
                    strip items if $text begins with a strip marker
           Product: MediaWiki
           Version: 1.16.0
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: easy
          Severity: minor
          Priority: Normal
         Component: Page rendering
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: foxlit.mwzi...@go-hero.net


The serialiseHalfParsedText method in the Parser class attempts to store all
strip markers, links, etc needed to render a bit of wikitext. It finds the
strip markers in the provided text using a while loop; in 1.16.0, this is in
includes/parser/Parser.php, line 5087:
while( ( $start_pos = strpos( $text, $this->mUniqPrefix, $pos ) ) && ( $end_pos
= strpos( $text, self::MARKER_SUFFIX, $pos ) ) )

If $text begins with a strip marker, $start_pos will be assigned 0; which
causes the while condition to be false; so serialiseHalfParsedText will not
store any strip markers at all; checking whether the strpos return is identical
to FALSE would fix this.

While I'm running into this issue on 1.16.0, the same while loop exists in SVN
revision 80248.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to