MediaWiki REL1_32
SpecialPageAliasTest.php
Go to the documentation of this file.
1<?php
2
15
21 foreach ( $specialPageAliases as $specialPage => $aliases ) {
22 foreach ( $aliases as $alias ) {
23 $msg = "$specialPage alias '$alias' in $code is valid with no slashes";
24 $this->assertRegExp( '/^[^\/]*$/', $msg );
25 }
26 }
27 }
28
30 $codes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );
31
32 $data = [];
33
34 foreach ( $codes as $code ) {
36
37 if ( $specialPageAliases !== [] ) {
38 $data[] = [ $code, $specialPageAliases ];
39 }
40 }
41
42 return $data;
43 }
44
50 protected function getSpecialPageAliases( $code ) {
51 $file = Language::getMessagesFileName( $code );
52
53 if ( is_readable( $file ) ) {
54 include $file;
55
56 if ( isset( $specialPageAliases ) && $specialPageAliases !== null ) {
58 }
59 }
60
61 return [];
62 }
63
64}
$specialPageAliases
Verifies that special page aliases are valid, with no slashes.
testValidSpecialPageAliases( $code, $specialPageAliases)
@coversNothing 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:895