Last modified: 2011-11-29 21:22:39 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 T34621, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32621 - Root /Foo style article paths and action paths conflict
Root /Foo style article paths and action paths conflict
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 32620
  Show dependency treegraph
 
Reported: 2011-11-24 06:42 UTC by Daniel Friesen
Modified: 2011-11-29 21:22 UTC (History)
2 users (show)

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


Attachments

Description Daniel Friesen 2011-11-24 06:42:07 UTC
It seams that root urls and action paths can have a bit of a conflict:

Under this setup:
$wgArticlePath = "/$1";
$wgActionPaths['edit'] = "/edit/$1";

Our code inside WebRequest.php parses the article path first, as a result the edit url /edit/Foo is interpreted as the article [[Edit/Foo]].

We may want to re-order the way we parse paths inside WebRequest.

Or perhaps we should replace the way we parse WebRequest sequentially with a system that will give more specific paths dominance.

ie: If we have /* and /edit/* then /edit/* will win out over /* because it's more dominant. An unlikely circumstance like $wgActionPath = "/wiki/*" and $wgArticlePath['render'] = "/*"; would work if we went based on specificity instead of sequential parsing order.
Comment 1 Brion Vibber 2011-11-24 16:26:28 UTC
"edit/Foo" is a legitimate page name (especially if $wgCapitalLinks is disabled)... this sort of thing is one of the reasons we recommend against putting your article and other spaces in the same place. :)

But if folks do do this, swapping the order to recognize action paths first is probably better behavior for most cases.
Comment 2 Daniel Friesen 2011-11-26 16:29:55 UTC
Should be fixed by r104274.
Comment 3 Voyagerfan5761 / dgw 2011-11-28 03:26:49 UTC
As of r104385 action paths defined in $wgActionPaths are still being intercepted as article titles.

Setting $wgActionPaths['edit'] = "/edit/$1": Page is treated as if the title is "Edit/$1", and displayed (though non-existent).

Setting above plus $wgActionPaths['view'] = "/view/$1": Redirect loop to "/view/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/View/$1"

I might not be setting the options correctly; my article-path-related LocalSettings.php code is below. Leaving as Resolved Fixed for now.


## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath       = "";
$wgScriptExtension  = ".php";
$wgScript           = "$wgScriptPath/index.php";
$wgArticlePath      = "/$1";

# Action paths
$actions = array( /*'view', causes redirect loop*/ 'edit', 'watch', 'unwatch', 'delete','revert', 'rollback',
  'protect', 'unprotect', 'markpatrolled', 'render', 'submit', 'history', 'purge' );

foreach ( $actions as $action ) {
  $wgActionPaths[$action] = "/$action/$1";
}
// $wgArticlePath = $wgActionPaths['view']; # causes redirect loop
Comment 4 Brion Vibber 2011-11-28 19:48:02 UTC
r104274 is breaking all non-English languages and may need to be reverted.

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


Navigation
Links