Last modified: 2014-10-21 13:16:27 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 T69003, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67003 - Parameters can be expanded multiple times when using Message::rawParam
Parameters can be expanded multiple times when using Message::rawParam
Status: NEW
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-23 21:51 UTC by Erik Bernhardson
Modified: 2014-10-21 13:16 UTC (History)
8 users (show)

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


Attachments

Description Erik Bernhardson 2014-06-23 21:51:39 UTC
Any i18n message that includes user generated content and at least one raw parameter is susceptible to having special sequences, like $1, from the user generated content replaced in the output.
 

Sample Code:

    $msg = new RawMessage( '$1 $2', array( 'First $2', 'Second $1' ) );
    echo $msg->text(), "\n";

    $msg = new RawMessage( '$1 $2', array( 'First $2', Message::rawParam( 'Second $1' ) ) );
    echo $msg->text(), "\n";

Expected Output:

    First $2 to the Second $1
    First $2 to the Second $1

Actual Output:

    First $2 to the Second $1
    First Second $1 to the Second $1


Utilizing Message::rawParam() should only change the result of that singular parameter, and not the entire message.

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


Navigation
Links