r97574 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97573‎ | r97574 | r97575 >
Date:23:23, 19 September 2011
Author:brion
Status:ok
Tags:
Comment:
MFT r97573 - hook to help with bug 31012 on MobileFrontend & similar
Modified paths:
  • /branches/REL1_18/phase3/docs/hooks.txt (modified) (history)
  • /branches/REL1_18/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/docs/hooks.txt
@@ -1736,6 +1736,11 @@
17371737 &$join_conds: join conditions for the tables
17381738 &$fields: array of query fields
17391739
 1740+'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.
 1741+$request: WebRequest
 1742+$title: Title of the currently found title obj
 1743+$output: OutputPage object
 1744+
17401745 'TitleArrayFromResult': called when creating an TitleArray object from a
17411746 database result
17421747 &$titleArray: set this to an object to override the default object returned
Index: branches/REL1_18/phase3/includes/Wiki.php
@@ -181,7 +181,8 @@
182182 } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted()
183183 && ( $request->getVal( 'title' ) === null ||
184184 $title->getPrefixedDBKey() != $request->getVal( 'title' ) )
185 - && !count( $request->getValueNames( array( 'action', 'title' ) ) ) )
 185+ && !count( $request->getValueNames( array( 'action', 'title' ) ) )
 186+ && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) ) )
186187 {
187188 if ( $title->getNamespace() == NS_SPECIAL ) {
188189 list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r97576MFT r97573 - hook to help with bug 31012 on MobileFrontend & similarbrion23:25, 19 September 2011
r97580MFT r97573 - hook to help with bug 31012 on MobileFrontend & similarbrion23:51, 19 September 2011
r97645fix for bug 31012 - mobile version replaced by desktop version in a webview o...preilly17:21, 20 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97573Add in a 'TestCanonicalRedirect' hook to be called when about to make a redir...brion23:14, 19 September 2011

Status & tagging log