Last active
May 16, 2020 08:59
-
-
Save pa4080/0e7770dfb497f6ed543c8be8110c0b66 to your computer and use it in GitHub Desktop.
Patch for MediaWiki Extension:CollapsibleVector - https://github.com/wikimedia/mediawiki-extensions-CollapsibleVector/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** CollapsibleVectorHooks.php 2020-04-16 19:53:58.903979173 +0300 | |
--- CollapsibleVectorHooks.patch.php 2020-04-16 19:53:17.347693246 +0300 | |
*************** | |
*** 46,51 **** | |
--- 46,56 ---- | |
public static function isEnabled( $name ) { | |
global $wgCollapsibleVectorFeatures, $wgUser; | |
+ // Handle global false and anonymous users | |
+ $is_anonymosus_user = filter_var($wgUser, FILTER_VALIDATE_IP); | |
+ if ( $is_anonymosus_user && $wgCollapsibleVectorFeatures['customSettings']['anonymous'] === false ) { | |
+ return false; | |
+ } | |
// Features with global set to true are always enabled | |
if ( | |
!isset( $wgCollapsibleVectorFeatures[$name] ) || $wgCollapsibleVectorFeatures[$name]['global'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with MediaWiki/CollapsibleVector REL1_34.