Index: branches/wmf/1.18wmf1/docs/hooks.txt |
— | — | @@ -1736,6 +1736,11 @@ |
1737 | 1737 | &$join_conds: join conditions for the tables |
1738 | 1738 | &$fields: array of query fields |
1739 | 1739 | |
| 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 | + |
1740 | 1745 | 'TitleArrayFromResult': called when creating an TitleArray object from a |
1741 | 1746 | database result |
1742 | 1747 | &$titleArray: set this to an object to override the default object returned |
Index: branches/wmf/1.18wmf1/includes/Wiki.php |
— | — | @@ -181,7 +181,8 @@ |
182 | 182 | } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted() |
183 | 183 | && ( $request->getVal( 'title' ) === null || |
184 | 184 | $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 ) ) ) |
186 | 187 | { |
187 | 188 | if ( $title->getNamespace() == NS_SPECIAL ) { |
188 | 189 | list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |