MediaWiki REL1_31
SpecialPageAliasTest.php
Go to the documentation of this file.
1<?php
2
14
19 foreach ( $specialPageAliases as $specialPage => $aliases ) {
20 foreach ( $aliases as $alias ) {
21 $msg = "$specialPage alias '$alias' in $code is valid with no slashes";
22 $this->assertRegExp( '/^[^\/]*$/', $msg );
23 }
24 }
25 }
26
28 $codes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );
29
30 $data = [];
31
32 foreach ( $codes as $code ) {
34
35 if ( $specialPageAliases !== [] ) {
36 $data[] = [ $code, $specialPageAliases ];
37 }
38 }
39
40 return $data;
41 }
42
48 protected function getSpecialPageAliases( $code ) {
49 $file = Language::getMessagesFileName( $code );
50
51 if ( is_readable( $file ) ) {
52 include $file;
53
54 if ( isset( $specialPageAliases ) && $specialPageAliases !== null ) {
56 }
57 }
58
59 return [];
60 }
61
62}
$specialPageAliases
Verifies that special page aliases are valid, with no slashes.
testValidSpecialPageAliases( $code, $specialPageAliases)
validSpecialPageAliasesProvider
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Definition hooks.txt:865