Index: trunk/extensions/CanonicalHref/CanonicalHref.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * https://wikia-code.com/wikia/trunk/extensions/wikia/HardRedirectsWithJSText/ |
13 | 13 | */ |
14 | 14 | |
15 | | -$wgHooks['SkinTemplateOutputPageBeforeExec'][] = "canonicalHref"; |
| 15 | +$wgHooks['BeforePageDisplay'][] = "canonicalHref"; |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'path' => __FILE__, |
— | — | @@ -21,13 +21,13 @@ |
22 | 22 | ); |
23 | 23 | |
24 | 24 | |
25 | | -function canonicalHref(&$skin, &$template){ |
26 | | - $link = Xml::element("link", array( |
27 | | - 'rel' => 'canonical', |
28 | | - 'href' => $skin->mTitle->getFullURL() |
| 25 | +function canonicalHref(&$out, &$skin){ |
| 26 | + $out->addLink( |
| 27 | + array( |
| 28 | + 'rel' => 'canonical', |
| 29 | + 'href' => $skin->mTitle->getFullURL() |
29 | 30 | ) |
30 | 31 | ); |
31 | | - $template->set('headlinks', $template->data['headlinks'] . "\n" . $link . "\n"); |
32 | 32 | return true; |
33 | 33 | } |
34 | 34 | |