Last modified: 2010-05-15 15:40:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 6822 - Article::getOldIDFromRequest fails to consider mTitle vs wgTitle
Article::getOldIDFromRequest fails to consider mTitle vs wgTitle
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
Macintosh Mac OS X 10.0
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-07-26 15:34 UTC by Travis D
Modified: 2010-05-15 15:40 UTC (History)
0 users

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


Description Travis D 2006-07-26 15:34:09 UTC
This function pulls out oldid from the wgRequest but fails to consider whether
or not the currrent article is actually the article being referenced in the
request, so in the case where  article->mTitle is different than $wgTitle, this
always loads the article specified by oldid. This doesn't really affect
wikipedia, but in other sites that have modifications that load articles
internally, any functionality that does a article->getContent() will be broken
if there's an oldid in the URL. I think a simple solution would be just to check
if the current article's title is actually the global title:

        global $wgRequest, $wgTitle;

        $this->mRedirectUrl = false;

        if (! ($wgTitle->getNamespace() == $this->mTitle->getNamespace() &&
               $wgTitle->getText() == $this->mTitle->getText() ) )
            return 0;
Comment 1 Brion Vibber 2006-07-26 20:42:13 UTC
If you specify an oldid, it's supposed to load that page. This 
allows permalinks to be made.

Not a bug.
Comment 2 Travis D 2006-07-26 20:45:05 UTC
Right, if you are only loading the article that has been requested.

But if your code loads ANOTHER article internally (say to populate a drop down
menu), if there's an oldid in the URL, it gets the article that's requested in
the URL, which isn't good. Like I said, this is fine for Wikipedia, but if
anyone is extending the functionality of Mediawiki, it's really problematic.
Comment 3 Brion Vibber 2006-07-26 20:46:30 UTC
No, that's how MediaWiki is meant to work. If your extension 
relies on $_REQUEST['title'] it is incorrect and will fail.
Comment 4 Travis D 2006-07-26 20:53:24 UTC
I'm not sure what you mean. 

My extension doesn't rely on what's in $_REQUEST['title']. We have  feature that
allows users to categorize articles through a drop down menu, these categories
are defined by the contents of an article, Project:Categories. This allows
admins to maintain the categories without coding changes. 

To populate the drop down menu, we fetch Article->getContent(). When editing an
out of date article, say for an article titled "Fry Fish", and populating the
drop down:

                $t = Title::newFromDBKey("Category");
                $a = new Article($t);
                $cats = $a->getContent();

returns the content of "Fry Fish" version from the oldid 19203, despite
a->mTitle being for the title "Category". 

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