Last modified: 2011-03-13 18:06:09 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 22609 - Incorrect articlepath and scriptpath returned for query&meta=siteinfo
Incorrect articlepath and scriptpath returned for query&meta=siteinfo
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
All All
: Lowest minor (vote)
: ---
Assigned To: Roan Kattouw
Depends on:
  Show dependency treegraph
Reported: 2010-02-21 13:32 UTC by Smallman
Modified: 2011-03-13 18:06 UTC (History)
5 users (show)

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


Description Smallman 2010-02-21 13:32:19 UTC
When querying siteinfo at,

It returns

<?xml version="1.0"?>
    <general mainpage="Main Page" base="" sitename="Wikipedia" generator="MediaWiki 1.16alpha-wmf" phpversion="5.2.4-2ubuntu5.7wm1" phpsapi="apache2handler" dbtype="mysql" dbversion="5.1.43-wm3193-log" rev="59858" case="first-letter" rights="Creative Commons Attribution-Share Alike 3.0 Unported" lang="en" fallback8bitEncoding="windows-1252" writeapi="" timezone="UTC" timeoffset="0" articlepath="/wiki/$1" scriptpath="/w" script="/w/index.php" variantarticlepath="" server="" wikiid="enwiki" />

Under articlepath, it returns "/wiki/$1" when it should return "/wiki/".

This is set by "$data['articlepath'] = $GLOBALS['wgArticlePath'];" in ApiQuerySiteinfo.php, so this is probably a problem in globals.
Comment 1 Smallman 2010-02-21 13:45:28 UTC
Actually, scriptpath is also wrong, it should return "/w/". This is set by "        $data['scriptpath'] = $GLOBALS['wgScriptPath'];", which is read from LocalSettings.php . 

For scriptpath it should probably append a "/" to $GLOBALS['wgScriptPath'], so itd be $GLOBALS['wgScriptPath']."\"
Comment 2 Smallman 2010-02-21 13:47:25 UTC
(I meant "/" for the above one).

For server, should it also append an extra "/" so it'd give "" rather than "".
Comment 3 Liangent 2010-02-21 14:20:36 UTC
In $wgArticlePath, $1 represents page title. See [[mw:Manual:$wgArticlePath]].

Why do you need that slash? Without it, we can concatenate them to make a URL easilier.
Comment 4 Bryan Tong Minh 2010-02-21 14:31:00 UTC
Server should not have a slash, because it specifies the protocol and the host name. The latter slash is part of the path.

The $1 is in wgArticlePath because presumably the article name does not have to be the last part of the url.

Whether or not wgScriptPath should have a trailing slash can be discussed, however we are not going to break backwards compatibility for something that can be easily solved client side.

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