File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ intensive.
66
77# Configuration
88
9+ * ` $wgCrawlerProtectedActions ` - array of actions to protect (default: ` [ 'history' ] ` ).
10+ Actions specified in this array will be denied for anonymous users.
11+ Set to an empty array ` [] ` to disable ` action= ` -based restrictions for anonymous users (other checks
12+ such as ` type=revision ` , ` diff ` , or ` oldid ` may still block requests).
913* ` $wgCrawlerProtectedSpecialPages ` - array of special pages to protect
1014 (default: ` [ 'mobilediff', 'recentchangeslinked', 'whatlinkshere' ] ` ).
1115 Supported values are special page names or their aliases regardless of case.
@@ -19,8 +23,6 @@ intensive.
1923 ` die(); ` with
2024 [ 418 I'm a teapot] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/418 )
2125 code (default: ` false ` )
22- * ` $wgCrawlerProtectedActions ` - add a list of actions to be denied
23- (default: ` [ 'history' ] ` ).
2426
2527# Version history
2628
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ public function onMediaWikiPerformAction(
7474 $ protectedActions = $ config ->get ( 'CrawlerProtectedActions ' );
7575 $ customDenialHeader = $ config ->get ( 'CrawlerProtectionDenialHeader ' );
7676 $ customDenialText = $ config ->get ( 'CrawlerProtectionDenialText ' );
77- $ use418 = $ config ->get ( 'CrawlerProtectionUse418 ' );
78- if ( empty ( $ customDenialHeader ) && empty ( $ customDenialText ) && $ use418 ) {
77+ $ denyFast = $ config ->get ( 'CrawlerProtectionUse418 ' );
78+ if ( empty ( $ customDenialHeader ) && empty ( $ customDenialText ) && $ denyFast ) {
7979 $ customDenialHeader = 'HTTP/1.0 I \'m a teapot ' ;
8080 $ customDenialText = 'I \'m a teapot ' ;
8181 }
@@ -118,8 +118,8 @@ public function onSpecialPageBeforeExecute( $special, $subPage ) {
118118 $ protectedSpecialPages = $ config ->get ( 'CrawlerProtectedSpecialPages ' );
119119 $ customDenialHeader = $ config ->get ( 'CrawlerProtectionDenialHeader ' );
120120 $ customDenialText = $ config ->get ( 'CrawlerProtectionDenialText ' );
121- $ use418 = $ config ->get ( 'CrawlerProtectionUse418 ' );
122- if ( empty ( $ customDenialHeader ) && empty ( $ customDenialText ) && $ use418 ) {
121+ $ denyFast = $ config ->get ( 'CrawlerProtectionUse418 ' );
122+ if ( empty ( $ customDenialHeader ) && empty ( $ customDenialText ) && $ denyFast ) {
123123 $ customDenialHeader = 'HTTP/1.0 I \'m a teapot ' ;
124124 $ customDenialText = 'I \'m a teapot ' ;
125125 }
You can’t perform that action at this time.
0 commit comments