Last modified: 2014-07-21 11:11:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67863, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65863 - Extraneous HTML produced by msg->parse()
Extraneous HTML produced by msg->parse()
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.22.6
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-28 17:32 UTC by Bob Dye
Modified: 2014-07-21 11:11 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bob Dye 2014-05-28 17:32:22 UTC
At some point fairly recently, the behavior of the Message Class parse function change, so that it now leaves extraneous HTML after the parsed text. This creates issues with output created by core Mediawiki functions that use this functionality.

Example: Parsing a message key that should result in the word "Contact" in English.

Message::parseText() returns:

    <p>Contact\n</p><p><br />\n</p>

The Message::toString function applies a Regex to this.

if ( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
    $string = $m[1];
}

It looks like this may be trying to remove the extraneous HTML, but it doesn't entirely succeed. Instead, the result is:

    Contact\n</p><p><br />

which, of course, creates unnecessary blank lines in the output.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links