Page MenuHomePhabricator

Fails to extract proper page information with modified $wgArticlePath
Closed, InvalidPublic

Description

Author: TikiTDO

Description:
Wiki installation is located in /wiki, RewriteRules were disabled for this example. When using a custom $wgArticlePath such as:

$wgArticlePath = "/wiki/$1";

Any access to the wiki though the actual entry point script such as:

GET /wiki/index.php?title=Main_Page&action=edit

or

GET /wiki/index.php?title=Main_Page&action=history

Will result in the parser attempting to operate on the [[Index.php]] page instead of the page in title.


Version: 1.11.x
Severity: normal

Details

Reference
bz10243

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:49 PM
bzimport set Reference to bz10243.
bzimport added a subscriber: Unknown Object (MLST).

TikiTDO wrote:

Patch for WebRequest::interpolateTitle() to process $wgScript before $wgArticlePath

Added patch that fixes above problem. The problem originated in WebRequest::interpolateTitle(). That function tries to figure out the title of the requested page based on the $wgArticlePath. If the path is set to allow Rewrite Conditions the action pages are still requested in the /index.php?actions format, which leads to the WebRequest::extractTitle() function to return index.php.

Attached:

This appears to be correct behavior per spec; /wiki/index.php?title=Main_Page&action=edit would indeed refer to a page "index.php" with additional parameters tacked on.

Your URL scheme overlaps two separate areas (the files & scripts area and the wiki-page-space area), and one's going to win out.

I would recommend fixing your URL scheme.

TikiTDO wrote:

Upon looking at it a bit more I can see what you meant and have fixed my mistake. It may be worth it to either reconsider this behaviour or do some extra documentation or checking, as a lot of examples online provided this type of configuration and it did not yield any problems in older releases.