Last modified: 2011-03-13 18:06:09 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 T24609, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22609 - Incorrect articlepath and scriptpath returned for query&meta=siteinfo
Incorrect articlepath and scriptpath returned for query&meta=siteinfo
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Lowest minor (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php?act...
:
Depends on:
Blocks:
  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: ---


Attachments

Description Smallman 2010-02-21 13:32:19 UTC
When querying siteinfo at http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo,

It returns

<?xml version="1.0"?>
<api>
  <query>
    <general mainpage="Main Page" base="http://en.wikipedia.org/wiki/Main_Page" 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="http://en.wikipedia.org" wikiid="enwiki" />
  </query>
</api>

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 "http://en.wikipedia.org/" rather than "http://en.wikipedia.org".
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.


Navigation
Links