http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97580
Revision: 97580
Author: brion
Date: 2011-09-19 23:51:21 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
MFT r97573 - hook to help with bug 31012 on MobileFrontend & similar
Modified Paths:
--------------
branches/wmf/1.18wmf1/docs/hooks.txt
branches/wmf/1.18wmf1/includes/Wiki.php
Modified: branches/wmf/1.18wmf1/docs/hooks.txt
===================================================================
--- branches/wmf/1.18wmf1/docs/hooks.txt 2011-09-19 23:48:57 UTC (rev
97579)
+++ branches/wmf/1.18wmf1/docs/hooks.txt 2011-09-19 23:51:21 UTC (rev
97580)
@@ -1736,6 +1736,11 @@
&$join_conds: join conditions for the tables
&$fields: array of query fields
+'TestCanonicalRedirect': called when about to force a redirect to a canonical
URL for a title when we have no other parameters on the URL. Gives a chance for
extensions that alter page view behavior radically to abort that redirect or
handle it manually.
+$request: WebRequest
+$title: Title of the currently found title obj
+$output: OutputPage object
+
'TitleArrayFromResult': called when creating an TitleArray object from a
database result
&$titleArray: set this to an object to override the default object returned
Modified: branches/wmf/1.18wmf1/includes/Wiki.php
===================================================================
--- branches/wmf/1.18wmf1/includes/Wiki.php 2011-09-19 23:48:57 UTC (rev
97579)
+++ branches/wmf/1.18wmf1/includes/Wiki.php 2011-09-19 23:51:21 UTC (rev
97580)
@@ -181,7 +181,8 @@
} elseif ( $request->getVal( 'action', 'view' ) == 'view' &&
!$request->wasPosted()
&& ( $request->getVal( 'title' ) === null ||
$title->getPrefixedDBKey() != $request->getVal(
'title' ) )
- && !count( $request->getValueNames( array( 'action',
'title' ) ) ) )
+ && !count( $request->getValueNames( array( 'action',
'title' ) ) )
+ && wfRunHooks( 'TestCanonicalRedirect', array(
$request, $title, $output ) ) )
{
if ( $title->getNamespace() == NS_SPECIAL ) {
list( $name, $subpage ) =
SpecialPageFactory::resolveAlias( $title->getDBkey() );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs