"Dantman" posted a comment on MediaWiki.r104688.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/104688#c27204

Commit summary for MediaWiki.r104688:

Followup r104274, r104676. Fix the bug that broke fr. Forgot to rawurldecode 
path contents.
Also add /u just for sanity sake.
Add new tests for url encoding, unicode, and length edge cases.

Dantman's comment:

Not really. You can have a plain /index.php that doesn't match anything and get 
back nothing. The behavior in that case is to redirect to the mainpage. (Though 
in the future I'd like to differentiate between something like / /index.php and 
/wiki/ which will go to the Main Page and something like /nothinghere that'll 
be sent to a '''real''' 404 page)

'title' isn't actually the only thing we rely on. There are some things like 
'oldid' which can work on their own.

So this theoretically should work as well (as long as we ask WebRequest for the 
info early enough):
<source lang=php>$router->add( '/permalink/$1', array( 'title' => false, 
'oldid' => '$1' ) );</source>

IMHO the only thing 'wrong' in this situation is we may want to eliminate the 
default 'title' if $1 is used somewhere else. ie: So <code>array( 'oldid' => 
'$1' )</code> alone will work the same as that snippet. But that's an api 
enhancement, not really a bugfix or fixme.

As for a) if you're talking about <code>$router->add( '/$2/$1', array( 'action' 
=> '$2' ) );</code> unless you explicitly set 'title' to something the default 
'title' => '$1' is added to the array. That's why I added the ability to 
explicitly set it to false.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to