r97580 MediaWiki - Code Review archive

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

Diff [purge]

Index: branches/wmf/1.18wmf1/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/wmf/1.18wmf1/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
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
r97574MFT r97573 - hook to help with bug 31012 on MobileFrontend & similarbrion23:23, 19 September 2011
r97576MFT r97573 - hook to help with bug 31012 on MobileFrontend & similarbrion23:25, 19 September 2011

Status & tagging log