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

           Summary: DateFormatter::reformat called unecessarily
           Product: MediaWiki
           Version: 1.15-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: Normal
         Component: Page rendering
        AssignedTo: [email protected]
        ReportedBy: [email protected]


In Parser::internalParse, a call is made to DateFormatter::reformat even when
the user's preference is set to 'default' which means that date formats should
remain unchanged.  This can be confirmed by noticing that (although the date
format remains unchanged) a comma is inserted into linked dates that are in MDY
format.

For example, the following wikitext:

[[March 30]] [[2007]]

Will be rendered in the page as:

[[March 30]], [[2007]]

While it's true that the comma is supposed to be there anyway, there's no
reason to use the reformat method to add it (it should just be added to the
wikitext directly.. and the actions of DateFormatter::reformat actually hide
this minor typo from casual readers, making it harder to notice and fix.)

In line 889 of Parser.php, this line:

 if( $this->mOptions->getUseDynamicDates() ) {

Should be changed to this:

 if( $this->mOptions->getUseDynamicDates() and $this-mOptions->getDateFormat()
!= 'default') {

That will prevent DateFormatter::reformat from being called unnecessarily and
both wasting CPU cycles (by checking against all the various date format
regexes when no actual date transformations will be applied) and hiding a minor
grammatical error that should be fixed directly.


-- 
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
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to