```
Targets
Occurrences of '(white|black)[ \-]?list' in Directory /Users/reedy/PhpstormProjects/mediawiki/core with mask '*.php'Selected files & directories
Found Occurrences (705464 usages found)
core (705464 usages found)
includedocs (218 usages found)
api (16 usages found)extension.schema.v2.json (2 usages found)
568 "ChangeCredentialsBlacklist": {
572 "RemoveCredentialsBlacklist": {
includes (243 usages found)
api (19 usages found)
i18n (3 usages found)
en.json (1 usage found)
23 Origin</code> header and the origin is whitelisted, the <code>Access-Control-Allow-Origin</code> and <code>Access-Control-Allow-Credentials</code> headers
pt-br.json (1 usage found)
37 Origin</code> e a origem for permitida (''whitelisted''), os cabeçalhos <code>Access-Control-Allow-Origin</code> e <code>Access-Control-Allow-Credentials
pt.json (1 usage found)
30 Origin</code> e a origem for permitida (''white-listed'') os cabeçalhos <code>Access-Control-Allow-Origin</code> e <code>Access-Control-Allow-Credentials
ApiAuthManagerHelper.php (1 usage found)
131 public static function blacklistAuthenticationRequests( array $reqs, array $remove ) {
ApiChangeAuthenticationData.php (2 usages found)
49 $reqs = ApiAuthManagerHelper::blacklistAuthenticationRequests(
51 $this->getConfig()->get( 'ChangeCredentialsBlacklist' )
ApiClientLogin.php (1 usage found)
98 $res->neededRequests = ApiAuthManagerHelper::blacklistAuthenticationRequests(
ApiQueryAuthManagerInfo.php (5 usages found)
74 // Filter out blacklisted requests, depending on the action
77 $reqs = ApiAuthManagerHelper::blacklistAuthenticationRequests(
78 $reqs, $this->getConfig()->get( 'ChangeCredentialsBlacklist' )
82 $reqs = ApiAuthManagerHelper::blacklistAuthenticationRequests(
83 $reqs, $this->getConfig()->get( 'RemoveCredentialsBlacklist' )
ApiQuerySiteinfo.php (1 usage found)
169 $data['imagewhitelistenabled'] = (bool)$config->get( 'EnableImageWhitelist' );
ApiRemoveAuthenticationData.php (1 usage found)
63 ? array_flip( $this->getConfig()->get( 'RemoveCredentialsBlacklist' ) )
ApiUpload.php (5 usages found)
669 if ( isset( $verification['blacklistedExt'] ) ) {
670 $msg[1] = Message::listParam( $verification['blacklistedExt'], 'comma' );
671 $msg[4] = count( $verification['blacklistedExt'] );
672 $extradata['blacklisted'] = array_values( $verification['blacklistedExt'] );
673 ApiResult::setIndexedTagName( $extradata['blacklisted'], 'ext' );
auth (7 usages found)
AuthManager.php (7 usages found)
1066 if ( $this->blockManager->isDnsBlacklisted( $ip, true /* check $wgProxyWhitelist */ ) ) {
1651 if ( $session->get( 'AuthManager::AutoCreateBlacklist' ) ) {
1652 $this->logger->debug( __METHOD__ . ': blacklisted in session {sessionid}', [
1658 $reason = $session->get( 'AuthManager::AutoCreateBlacklist' );
1671 $session->set( 'AuthManager::AutoCreateBlacklist', 'noname' );
1686 $session->set( 'AuthManager::AutoCreateBlacklist', 'authmanager-autocreate-noperm' );
1721 $session->set( 'AuthManager::AutoCreateBlacklist', $status );
block (24 usages found)
AbstractBlock.php (1 usage found)
276 * may be blacklisted or whitelisted, or determined from a
BlockManager.php (18 usages found)
60 'DnsBlacklistUrls',
61 'EnableDnsBlacklist',
63 'ProxyWhitelist',
208 if ( !in_array( $ip, $this->options->get( 'ProxyWhitelist' ) ) ) {
216 } elseif ( $isAnon && $this->isDnsBlacklisted( $ip ) ) {
238 && !in_array( $ip, $this->options->get( 'ProxyWhitelist' ) )
363 * Whether the given IP is in a DNS blacklist.
366 * @param bool $checkAllowed Whether to check $wgProxyWhitelist first
367 * @return bool True if blacklisted.
369 public function isDnsBlacklisted( $ip, $checkAllowed = false ) {
370 if ( !$this->options->get( 'EnableDnsBlacklist' ) ||
371 ( $checkAllowed && in_array( $ip, $this->options->get( 'ProxyWhitelist' ) ) )
376 return $this->inDnsBlacklist( $ip, $this->options->get( 'DnsBlacklistUrls' ) );
380 * Whether the given IP is in a given DNS blacklist.
383 * @param string[] $bases URL of the DNS blacklist
384 * @return bool True if blacklisted.
386 private function inDnsBlacklist( $ip, array $bases ) {
436 * @return string[]|bool IPv4 array, or false if the IP is not blacklisted
DatabaseBlock.php (2 usages found)
548 public static function isWhitelistedFromAutoblocks( $ip ) {
574 . "\n" . wfMessage( 'autoblock_whitelist' )->inContentLanguage()->plain()
SystemBlock.php (3 usages found)
27 * from IP blacklists) and are not saved to the database. The target of a
60 * - 'proxy': the IP is blacklisted in $wgProxyList
61 * - 'dnsbl': the IP is associated with a blacklisted domain in $wgDnsBlacklistUrls
composer (6 usages found)
ComposerPhpunitXmlCoverageEdit.php (6 usages found)
41 $whitelist = iterator_to_array( $phpunitXml->getElementsByTagName( 'whitelist' ) );
43 foreach ( $whitelist as $childNode ) {
46 $whitelistElement = $phpunitXml->createElement( 'whitelist' );
47 $whitelistElement->setAttribute( 'addUncoveredFilesFromWhitelist', 'false' );
52 $whitelistElement->appendChild( $dirElement );
56 ->appendChild( $whitelistElement );
gallery (2 usages found)
ImageGalleryBase.php (1 usage found)
77 * @var bool Hide blacklisted images?
TraditionalImageGallery.php (1 usage found)
121 # The image is blacklisted, just show it as a text link.
HookContainer (4 usages found)
HookRunner.php (4 usages found)
482 \MediaWiki\Permissions\Hook\TitleReadWhitelistHook,
4039 public function onTitleReadWhitelist( $title, $user, &$whitelisted ) {
4041 'TitleReadWhitelist',
4042 [ $title, $user, &$whitelisted ]
jobqueue (5 usages found)
JobQueueFederated.php (1 usage found)
292 unset( $partitionsTry[$partition] ); // blacklist partition
JobRunner.php (4 usages found)
221 $blacklist = $throttle ? array_keys( $backoffs ) : [];
227 ->pop( JobQueueGroup::TYPE_DEFAULT, JobQueueGroup::USE_CACHE, $blacklist );
230 // that type of job is currently rate-limited by the back-off blacklist
231 $job = in_array( $type, $blacklist ) ? false : $this->jobQueueGroup->pop( $type );
libs (2 usages found)
mime (1 usage found)
XmlTypeCheck.php (1 usage found)
414 * We whitelist an extremely restricted subset of DTD features.
Cookie.php (1 usage found)
77 * A better method might be to use a blacklist like
page (1 usage found)
Article.php (1 usage found)
492 # Another whitelist check in case getOldID() is altering the title
pager (1 usage found)
TablePager.php (1 usage found)
408 * blacklist, passed in the $blacklist parameter.
parser (14 usages found)
Parser.php (6 usages found)
2314 * option, through the exception, or through the on-wiki whitelist
2347 if ( !$text && $this->mOptions->getEnableImageWhitelist()
2350 $whitelist = explode(
2352 wfMessage( 'external_image_whitelist' )->inContentLanguage()->text()
2355 foreach ( $whitelist as $entry ) {
2362 # Image matches a whitelist entry
ParserOptions.php (8 usages found)
299 * Use the on-wiki external image whitelist?
302 public function getEnableImageWhitelist() {
303 return $this->getOption( 'enableImageWhitelist' );
307 * Use the on-wiki external image whitelist?
313 public function setEnableImageWhitelist( $x ) {
315 return $this->setOptionLegacy( 'enableImageWhitelist', $x );
1244 $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion,
1293 'enableImageWhitelist' => $wgEnableImageWhitelist,
Permissions (22 usages found)
Hook (5 usages found)
TitleReadWhitelistHook.php (5 usages found)
10 * Use the hook name "TitleReadWhitelist" to register handlers implementing this interface.
15 interface TitleReadWhitelistHook {
24 * @param bool &$whitelisted Whether this title is whitelisted
25 * @return bool|void True or no return value to continue, or false to *not* whitelist
28 public function onTitleReadWhitelist( $title, $user, &$whitelisted );
PermissionManager.php (17 usages found)
66 'WhitelistRead',
67 'WhitelistReadRegexp',
571 $whiteListRead = $this->options->get( 'WhitelistRead' );
589 } elseif ( is_array( $whiteListRead ) && count( $whiteListRead ) ) {
590 # Time to check the whitelist
595 // Check for explicit whitelisting with and without underscores
596 if ( in_array( $name, $whiteListRead, true )
597 || in_array( $dbName, $whiteListRead, true ) ) {
602 if ( in_array( ':' . $name, $whiteListRead ) ) {
612 if ( in_array( $pure, $whiteListRead, true ) ) {
619 $whitelistReadRegexp = $this->options->get( 'WhitelistReadRegexp' );
620 if ( !$allowed && is_array( $whitelistReadRegexp )
621 && !empty( $whitelistReadRegexp ) ) {
623 // Check for regex whitelisting
624 foreach ( $whitelistReadRegexp as $listItem ) {
633 # If the title is not whitelisted, give extensions a chance to do so...
634 $this->hookRunner->onTitleReadWhitelist( $title, $user, $allowed );
preferences (8 usages found)
DefaultPreferencesFactory.php (7 usages found)
111 'EnableUserEmailBlacklist',
174 public function getSaveBlacklist() {
238 if ( $disable && !in_array( $name, $this->getSaveBlacklist() ) ) {
753 if ( $this->options->get( 'EnableUserEmailBlacklist' ) ) {
754 $defaultPreferences['email-blacklist'] = [
756 'label-message' => 'email-blacklist-label',
1784 foreach ( $this->getSaveBlacklist() as $b ) {
PreferencesFactory.php (1 usage found)
85 public function getSaveBlacklist();
registration (4 usages found)
ExtensionProcessor.php (4 usages found)
22 'ChangeCredentialsBlacklist',
51 'RemoveCredentialsBlacklist',
252 // Only whitelisted attributes are set
261 // If it's not blacklisted, it's an attribute
session (1 usage found)
SessionProvider.php (1 usage found)
404 * occurring in the future. This might add the username to a blacklist, or
shell (325 usages found)
Command.php (3 usages found)
201 * whitelisted will be available to the shell command.
203 * limit.sh will always be whitelisted
209 public function whitelistPaths( array $paths ): Command {
firejail.profile (22 usages found)
22 blacklist /sbin
23 blacklist /usr/sbin
24 blacklist /usr/local/sbin
26 # Blacklist /run which typically contains many exploitable UNIX sockets. But
27 # don't blacklist /run/firejail which firejail needs. Using a glob means that
29 # the noblacklist directive to work. (T262364)
30 noblacklist /run/firejail
31 blacklist /run/*
34 blacklist /etc/shadow
35 blacklist /etc/ssh
36 blacklist /root
39 blacklist ${PATH}/umount
40 blacklist ${PATH}/mount
41 blacklist ${PATH}/fusermount
42 blacklist ${PATH}/su
43 blacklist ${PATH}/sudo
44 blacklist ${PATH}/xinput
45 blacklist ${PATH}/evtest
46 blacklist ${PATH}/xev
47 blacklist ${PATH}/strace
48 blacklist ${PATH}/nc
49 blacklist ${PATH}/ncat
specialpage (3 usages found)
AuthManagerSpecialPage.php (3 usages found)
232 * Allows blacklisting certain request types.
236 protected function getRequestBlacklist() {
277 return !in_array( get_class( $req ), $this->getRequestBlacklist(), true );
specials (20 usages found)
forms (1 usage found)
UploadForm.php (1 usage found)
264 $prohibitedExtensions = array_unique( $config->get( 'FileBlacklist' ) );
SpecialChangeCredentials.php (2 usages found)
285 protected function getRequestBlacklist() {
286 return $this->getConfig()->get( 'ChangeCredentialsBlacklist' );
SpecialEmailUser.php (1 usage found)
243 $muteList = $target->getOption( 'email-blacklist', '' );
SpecialLinkAccounts.php (2 usages found)
33 protected function getRequestBlacklist() {
34 return $this->getConfig()->get( 'ChangeCredentialsBlacklist' );
SpecialMute.php (5 usages found)
164 * @param string $userOption up_property key that holds the blacklist
200 $config->get( 'EnableUserEmailBlacklist' ) &&
204 $fields['email-blacklist'] = [
210 'default' => $this->isTargetMuted( 'email-blacklist' ),
254 public function isTargetBlacklisted( $userOption ) {
SpecialRemoveCredentials.php (2 usages found)
27 protected function getRequestBlacklist() {
28 return $this->getConfig()->get( 'RemoveCredentialsBlacklist' );
SpecialShortPages.php (1 usage found)
66 $config->get( 'ShortPagesNamespaceBlacklist' )
SpecialUnlinkAccounts.php (2 usages found)
38 protected function getRequestBlacklist() {
39 return $this->getConfig()->get( 'RemoveCredentialsBlacklist' );
SpecialUpload.php (4 usages found)
758 if ( isset( $details['blacklistedExt'] ) ) {
759 $msg->params( $this->getLanguage()->commaList( $details['blacklistedExt'] ) );
770 if ( isset( $details['blacklistedExt'] ) ) {
771 $msg->params( count( $details['blacklistedExt'] ) );
upload (29 usages found)
UploadBase.php (25 usages found)
79 protected $mBlackListedExtensions;
361 * - 'blacklistedExt': set to the list of blacklisted file extensions if the current file extension
362 * is not allowed for uploads and the blacklist is not empty
425 if ( count( $this->mBlackListedExtensions ) ) {
426 $result['blacklistedExt'] = $this->mBlackListedExtensions;
450 global $wgMimeTypeBlacklist;
451 if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
466 if ( $this->checkFileExtension( $ieType, $wgMimeTypeBlacklist ) ) {
540 * Runs the blacklist checks, but not any checks that may
1033 * We'll want to blacklist against *any* 'extension', and use
1034 * only the final one for the whitelist.
1065 /* Don't allow users to override the blacklist (check file extension) */
1067 global $wgFileExtensions, $wgFileBlacklist;
1069 $blackListedExtensions = $this->checkFileExtensionList( $ext, $wgFileBlacklist );
1076 } elseif ( $blackListedExtensions ||
1080 $this->mBlackListedExtensions = $blackListedExtensions;
1245 * scripts, so the blacklist needs to check them all.
1449 * Check a whitelist of xml encodings that are known not to be interpreted differently
1482 // detect the encoding in case is specifies an encoding not whitelisted in self::$safeXmlEncodings
1586 * @todo Replace this with a whitelist filter!
1727 wfDebug( __METHOD__ . ": Found href to unwhitelisted data: uri "
2129 foreach ( self::getFilenamePrefixBlacklist() as $prefix ) {
2159 * Get a list of blacklisted filename prefixes from [[MediaWiki:Filename-prefix-blacklist]]
2163 public static function getFilenamePrefixBlacklist() {
2165 $message = wfMessage( 'filename-prefix-blacklist' )->inContentLanguage();
UploadFromUrl.php (2 usages found)
71 * The domains in the whitelist can include wildcard characters (*) in place
88 // See if the domain for the upload matches this whitelisted domain
UploadStash.php (2 usages found)
479 global $wgFileBlacklist;
493 if ( in_array( $extension, $wgFileBlacklist ) ) {
user (1 usage found)
UserOptionsManager.php (1 usage found)
315 $specialOptions = array_fill_keys( $preferencesFactory->getSaveBlacklist(), true );
ContentSecurityPolicy.php (5 usages found)
246 // A future todo might be to make the whitelist options only
247 // add all the whitelisted sites to the header, instead of
256 } elseif ( $mwConfig->get( 'EnableImageWhitelist' ) ) {
257 $whitelist = wfMessage( 'external_image_whitelist' )
260 if ( preg_match( '/^\s*[^\s#]/m', $whitelist ) ) {
DefaultSettings.php (29 usages found)
1090 $wgFileBlacklist = [
1105 $wgMimeTypeBlacklist = [
1853 * Set to true to enable user-to-user e-mail blacklist.
1857 $wgEnableUserEmailBlacklist = false;
4670 * Optional array of namespaces which should be blacklisted from Special:ShortPages
4671 * Only pages inside $wgContentNamespaces but not $wgShortPagesNamespaceBlacklist will
4675 $wgShortPagesNamespaceBlacklist = [];
4897 * Set this to true to enable the on-wiki allow list (MediaWiki:External image whitelist)
4902 $wgEnableImageWhitelist = false;
5430 $wgChangeCredentialsBlacklist = [
5443 $wgRemoveCredentialsBlacklist = [
5610 'msg:sorbs', // For $wgEnableDnsBlacklist etc.
5815 * $wgWhitelistRead = [ "Main Page", "Wikipedia:Help" ];
5827 * @note Extensions should not modify this, but use the TitleReadWhitelist
5830 $wgWhitelistRead = false;
5839 * To whitelist [[Main Page]]:
5841 * $wgWhitelistReadRegexp = [ "/Main Page/" ];
5851 * $wgWhitelistReadRegexp = [ "@^UsEr.*@i" ];
5858 $wgWhitelistReadRegexp = false;
5894 * This replaces $wgWhitelistAccount and $wgWhitelistEdit
6376 * Whether to use DNS blacklists in $wgDnsBlacklistUrls to check for open
6380 $wgEnableDnsBlacklist = false;
6383 * List of DNS blacklists to use, if $wgEnableDnsBlacklist is true.
6386 * the blacklist require a key).
6390 * $wgDnsBlacklistUrls = [
6405 $wgDnsBlacklistUrls = [ 'http.dnsbl.sorbs.net.' ];
6418 * Proxy whitelist, list of addresses that are assumed to be non-proxy despite
6421 $wgProxyWhitelist = [];
9441 /* MediaWiki whitelist */
GitInfo.php (1 usage found)
254 ->whitelistPaths( [ $gitDir, $this->repoDir ] )
GlobalFunctions.php (1 usage found)
1475 # @todo FIXME: We may want to blacklist some broken browsers
OutputPage.php (1 usage found)
2762 $msg = 'whitelistedittext';
Setup.php (2 usages found)
249 // Blacklisted file extensions shouldn't appear on the "allowed" list
250 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
StreamFile.php (4 usages found)
105 global $wgFileBlacklist, $wgCheckFileExtensions, $wgStrictFileExtensions,
106 $wgFileExtensions, $wgVerifyMimeType, $wgMimeTypeBlacklist;
108 if ( UploadBase::checkFileExtensionList( $extList, $wgFileBlacklist ) ) {
116 if ( $wgVerifyMimeType && in_array( strtolower( $type ), $wgMimeTypeBlacklist ) ) {
WebRequest.php (2 usages found)
1169 * @param array $extWhitelist
1172 public function checkUrlExtension( $extWhitelist = [] ) {
tests (802 usages found)
phpunit (802 usages found)
includes (73 usages found)
auth (18 usages found)
AuthManagerTest.php (18 usages found)
1570 'wgEnableDnsBlacklist' => true,
1571 'wgDnsBlacklistUrls' => [
1574 'wgProxyWhitelist' => [],
1580 $this->setMwGlobals( 'wgProxyWhitelist', [ '127.0.0.1' ] );
2604 // Session blacklisted
2606 $session->set( 'AuthManager::AutoCreateBlacklist', 'test' );
2616 [ LogLevel::DEBUG, 'blacklisted in session {sessionid}' ],
2621 $session->set( 'AuthManager::AutoCreateBlacklist', StatusValue::newFatal( 'test2' ) );
2631 [ LogLevel::DEBUG, 'blacklisted in session {sessionid}' ],
2649 $this->assertSame( 'noname', $session->get( 'AuthManager::AutoCreateBlacklist' ) );
2669 'authmanager-autocreate-noperm', $session->get( 'AuthManager::AutoCreateBlacklist' )
2741 StatusValue::newFatal( 'fail-in-pre' ), $session->get( 'AuthManager::AutoCreateBlacklist' )
2758 StatusValue::newFatal( 'fail-in-primary' ), $session->get( 'AuthManager::AutoCreateBlacklist' )
2775 StatusValue::newFatal( 'fail-in-secondary' ), $session->get( 'AuthManager::AutoCreateBlacklist' )
2795 $this->assertSame( null, $session->get( 'AuthManager::AutoCreateBlacklist' ) );
2815 $this->assertSame( null, $session->get( 'AuthManager::AutoCreateBlacklist' ) );
2840 $this->assertSame( null, $session->get( 'AuthManager::AutoCreateBlacklist' ) );
2869 $this->assertSame( null, $session->get( 'AuthManager::AutoCreateBlacklist' ) );
block (40 usages found)
BlockManagerTest.php (40 usages found)
34 'wgDnsBlacklistUrls' => [],
35 'wgEnableDnsBlacklist' => true,
37 'wgProxyWhitelist' => [],
273 * @dataProvider provideIsDnsBlacklisted
274 * @covers ::isDnsBlacklisted
275 * @covers ::inDnsBlacklist
277 public function testIsDnsBlacklisted( $options, $expected ) {
279 'wgEnableDnsBlacklist' => true,
280 'wgDnsBlacklistUrls' => $options['blacklist'],
281 'wgProxyWhitelist' => $options['whitelist'],
296 $blockManager->isDnsBlacklisted( $options['ip'], $options['checkWhitelist'] )
300 public static function provideIsDnsBlacklisted() {
304 'IP is blacklisted' => [
306 'blacklist' => [ 'dnsbl.test' ],
310 'whitelist' => [],
311 'checkWhitelist' => false,
315 'IP is blacklisted; blacklist has key' => [
317 'blacklist' => [ [ 'dnsbl.test', 'key' ] ],
321 'whitelist' => [],
322 'checkWhitelist' => false,
326 'IP is blacklisted; blacklist is array' => [
328 'blacklist' => [ [ 'dnsbl.test' ] ],
332 'whitelist' => [],
333 'checkWhitelist' => false,
337 'IP is not blacklisted' => [
339 'blacklist' => [ 'dnsbl.test' ],
343 'whitelist' => [],
344 'checkWhitelist' => false,
348 'Blacklist is empty' => [
350 'blacklist' => [],
354 'whitelist' => [],
355 'checkWhitelist' => false,
359 'IP is blacklisted and whitelisted; whitelist is not checked' => [
361 'blacklist' => [ 'dnsbl.test' ],
365 'whitelist' => [ '127.0.0.1' ],
366 'checkWhitelist' => false,
370 'IP is blacklisted and whitelisted; whitelist is checked' => [
372 'blacklist' => [ 'dnsbl.test' ],
376 'whitelist' => [ '127.0.0.1' ],
377 'checkWhitelist' => true,
password (1 usage found)
UserPasswordPolicyTest.php (1 usage found)
85 'PasswordCannotMatchBlacklist' => true,
specials (13 usages found)
SpecialMuteTest.php (11 usages found)
19 'wgEnableUserEmailBlacklist' => true
48 public function testEmailBlacklistNotEnabled() {
55 'wgEnableUserEmailBlacklist' => false
77 public function testMuteAddsUserToEmailBlacklist() {
85 $this->userOptionsManager->setOption( $loggedInUser, 'email-blacklist', "999" );
89 $fauxRequest = new FauxRequest( [ 'wpemail-blacklist' => true ], true );
97 $this->userOptionsManager->getOption( $loggedInUser, 'email-blacklist' )
104 public function testUnmuteRemovesUserFromEmailBlacklist() {
112 $this->userOptionsManager->setOption( $loggedInUser, 'email-blacklist', "999\n" . $targetUser->getId() );
116 $fauxRequest = new FauxRequest( [ 'wpemail-blacklist' => false ], true );
122 $this->assertSame( "999", $this->userOptionsManager->getOption( $loggedInUser, 'email-blacklist' ) );
SpecialShortPagesTest.php (2 usages found)
18 public function testGetQueryInfoRespectsContentNS( $contentNS, $blacklistNS, $expectedNS ) {
20 'wgShortPagesNamespaceBlacklist' => $blacklistNS,
ContentSecurityPolicyTest.php (1 usage found)
19 'wgEnableImageWhitelist' => false,
unit (7 usages found)
includes (7 usages found)
Permissions (2 usages found)
PermissionManagerTest.php (2 usages found)
35 'WhitelistRead' => false,
36 'WhitelistReadRegexp' => false,
BadFileLookupTest.php (5 usages found)
177 'Context page not whitelisted' =>
180 'Whitelisted context page' =>
184 'Bad image with Image: in blacklist' => [ 'Bad2.jpg', null, true ],
185 'Bad image without prefix in blacklist' => [ 'Bad3.jpg', null, true ],
186 'Bad image with different namespace in blacklist' => [ 'Bad4.jpg', null, true ],
vendor (406 usages found)
composer (4 usages found)
autoload_classmap.phpsuite.xml (2 usages found)
1381 'PHPUnit\\Util\\Black67 <whitelist' => $vendorDir . '/phpunit/phpunit/src/Util/Black addUncoveredFilesFromWhitelist.php',="true">
2771 'SebastianBergmann\\GlobalState\\Blacklist' => $vendorDir . '/sebastian/global-state/src/Blacklist.php',
autoload_static.php (2 usages found)77 </whitelist>
1892 'PHPUnit\\Util\\Blacklist' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Blacklist.php',
3282 'SebastianBergmann\\GlobalState\\Blacklist' => __DIR__ . '/..' . '/sebastian/global-state/src/Blacklist.php',.phpcs.xml (8 usages found)
mediawiki (7 usages found)
mediawiki-codesniffer (1 usage found)
MediaWiki (1 usage found)
Sniffs (1 usage found)
PHPUnit (1 usage found)
AssertionOrderSniff.php (1 usage found)
93 // Not a comparison to one of the whitelisted literals
mediawiki-phan-config (1 usage found)
src (1 usage found)
config.php (1 usage found)
52 'whitelist_issue_types' => [],
phan-taint-check-plugin (5 usages found)
scripts (5 usages found)
base-config.php (5 usages found)
54 /** We use the whitelist instead */
59 * If this white-list is non-empty73 Whitelist existing violations, only issues within the list
62 'whitelist_issue_types' => [
74 // Rely on severity setting to blacklist false positive.
104 'unused_suppression_whitelisted_only' => truebut enable the sniff to prevent
oojs (6 usages found)
oojs-ui (6 usages found)
php (6 usages found)
layouts (2 usages found)
FormLayout.php (2 usages found)
30 $attributeWhitelist = [ 'method', 'action', 'enctype' ];
33 ->setAttributes( array_intersect_key( $config, array_flip( $attributeWhitelist ) ) );
Tag.php (4 usages found)
363 * anyway), but there's no good way to blacklist them because of very lax parsing in browsers.
368 * - it starts with a whitelisted protocol, followed by a colon (absolute URL)119 Whitelist existing violations, or
382 $protocolWhitelist = [
393 foreach ( $protocolWhitelist as $protocol ) {but enable the sniff to prevent
phan (39 usages found)
phan (39 usages found)
.phan (23 usages found)
plugins (22 usages found)
InlineHTMLPlugin.php (8 usages found)
36 private $whitelist_regex;
38 private $blacklist_regex;
43 $this->whitelist_regex = $plugin_config['inline_html_whitelist_regex'] ?? null;
44 $this->blacklist_regex = $plugin_config['inline_html_blacklist_regex'] ?? null;
49 if (is_string($this->blacklist_regex)) {
50 if (CLI::isPathMatchedByRegex($this->blacklist_regex, $path)) {
54 if (is_string($this->whitelist_regex)) {
55 return CLI::isPathMatchedByRegex($this->whitelist_regex, $path);
MoreSpecificElementTypePlugin.php (4 usages found)
56 public static $method_blacklist;
74 if (self::$method_blacklist->offsetExists($fqsen)) {
78 self::$method_blacklist->attach($fqsen);
194 MoreSpecificElementTypePlugin::$method_blacklist = new Set();
PHPUnitNotDeadCodePlugin.php (2 usages found)
93 if ($class->hasPropertyWithName($code_base, 'backupStaticAttributesBlacklist')) {
94 $property = $class->getPropertyByName($code_base, 'backupStaticAttributesBlacklist');
SleepCheckerPlugin.php (1 usage found)
96 $regex = Config::getValue('plugin_config')['sleep_transient_warning_blacklist_regex'] ?? null;
UnknownClassElementAccessPlugin.php (2 usages found)
91 public static function blacklistMethodIssue(Context $context, Node $node): void
147 UnknownClassElementAccessPlugin::blacklistMethodIssue($this->context, $node);
UnusedSuppressionPlugin.php (5 usages found)
218 private static function getReportOnlyWhitelisted(): bool
220 return Config::getValue('plugin_config')['unused_suppression_whitelisted_only'] ?? false;
226 $only_whitelisted = self::getReportOnlyWhitelisted();
227 $issue_whitelist = Config::getValue('whitelist_issue_types') ?? [];
230 (!$only_whitelisted || in_array($issue_type, $issue_whitelist, true));
config.php (1 usage found)
384 'whitelist_issue_types' => [
src (16 usages found)
Phan (16 usages found)
AST (1 usage found)
TolerantASTConverter (1 usage found)
TolerantASTConverterWithNodeMapping.php (1 usage found)
157 * We use a blacklist because there are more many more tokens we want to use the parent for.
CodeBase (1 usage found)
UndoTracker.php (1 usage found)
57 * (This is the list prior to any analysis exclusion or whitelisting steps)
Language (6 usages found)
Element (1 usage found)
Comment.php (1 usage found)
32 * @phan-file-suppress PhanAccessReadOnlyProperty TODO: Add a way to whitelist private methods that are only accessible from initializers (__construct, __wakeup, etc.)
Internal (4 usages found)
FunctionDocumentationMap.php (4 usages found)
856 'Cassandra\Cluster\Builder::withBlackListDCs' => 'Sets the blacklist datacenters. Any datacenter in the blacklist will be
860 'Cassandra\Cluster\Builder::withBlackListHosts' => 'Sets the blacklist hosts. Any host in the blacklist will be ignored and
930 'Cassandra\Cluster\Builder::withWhiteListDCs' => 'Sets the whitelist datacenters. Any host not in a whitelisted datacenter
933 'Cassandra\Cluster\Builder::withWhiteListHosts' => 'Sets the whitelist hosts. Any host not in the whitelist will be ignored
Type.php (1 usage found)
124 * Note that string literals can only contain a whitelist of characters.
CodeBase.php (1 usage found)
311 * (This is the list prior to any analysis exclusion or whitelisting steps)
Config.php (2 usages found)
724 'whitelist_issue_types' => [
1645 'whitelist_issue_types' => $is_string_list,
Issue.php (5 usages found)
5662 // If a white-list of allowed issue types is defined,
5663 // only emit issues on the white-list
5664 $whitelist_issue_types = Config::getValue('whitelist_issue_types') ?? [];
5665 if (\count($whitelist_issue_types) > 0 &&
5666 !\in_array($issue_type, $whitelist_issue_types, true)) {166 Whitelist existing violations, but enable the sniff to prevent
phpunit (209 usages found)
php-code-coverage (108 usages found)
src (59 usages found)
Report (3 usages found)
Xml (1 usage found)
Facade.php (1 usage found)
223 if ($test === 'UNCOVERED_FILES_FROM_WHITELIST') {
PHP.php (2 usages found)
34 $filter->setWhitelistedFiles(%s);
39 \var_export($filter->getWhitelistedFiles(), true)
CodeCoverage.php (24 usages found)
72 private $addUncoveredFilesFromWhitelist = true;
77 private $processUncoveredFilesFromWhitelist = false;
116 private $unintentionallyCoveredSubclassesWhitelist = [];
193 if (!$raw && $this->addUncoveredFilesFromWhitelist) {
194 $this->addUncoveredFilesFromWhitelist();
298 $this->applyWhitelistFilter($data);
306 if ($id !== 'UNCOVERED_FILES_FROM_WHITELIST') {
366 $this->filter->setWhitelistedFiles(
367 \array_merge($this->filter->getWhitelistedFiles(), $that->filter()->getWhitelistedFiles())
435 public function setAddUncoveredFilesFromWhitelist(bool $flag): void
437 $this->addUncoveredFilesFromWhitelist = $flag;
440 public function setProcessUncoveredFilesFromWhitelist(bool $flag): void
442 $this->processUncoveredFilesFromWhitelist = $flag;
455 public function setUnintentionallyCoveredSubclassesWhitelist(array $whitelist): void
457 $this->unintentionallyCoveredSubclassesWhitelist = $whitelist;
537 private function applyWhitelistFilter(array &$data): void
583 private function addUncoveredFilesFromWhitelist(): void
587 $this->filter->getWhitelist(),
605 $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST');
924 foreach ($this->unintentionallyCoveredSubclassesWhitelist as $whitelisted) {
925 if ($class->isSubclassOf($whitelisted)) {
948 if ($this->processUncoveredFilesFromWhitelist) {
953 foreach ($this->filter->getWhitelist() as $file) {
975 $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST');
Filter.php (32 usages found)
15 * Filter for whitelisting of code coverage information.
20 * Source files that are whitelisted.
24 private $whitelistedFiles = [];
34 * Adds a directory to the whitelist (recursively).
36 public function addDirectoryToWhitelist(string $directory, string $suffix = '.php', string $prefix = ''): void
42 $this->addFileToWhitelist($file);
47 * Adds a file to the whitelist.
49 public function addFileToWhitelist(string $filename): void
57 $this->whitelistedFiles[$filename] = true;
61 * Adds files to the whitelist.
65 public function addFilesToWhitelist(array $files): void
68 $this->addFileToWhitelist($file);
73 * Removes a directory from the whitelist (recursively).
75 public function removeDirectoryFromWhitelist(string $directory, string $suffix = '.php', string $prefix = ''): void
81 $this->removeFileFromWhitelist($file);
86 * Removes a file from the whitelist.
88 public function removeFileFromWhitelist(string $filename): void
92 if (!$filename || !isset($this->whitelistedFiles[$filename])) {
96 unset($this->whitelistedFiles[$filename]);
136 return !isset($this->whitelistedFiles[$filename]);
140 * Returns the list of whitelisted files.
144 public function getWhitelist(): array
146 return \array_keys($this->whitelistedFiles);
150 * Returns whether this filter has a whitelist.
152 public function hasWhitelist(): bool
154 return !empty($this->whitelistedFiles);
158 * Returns the whitelisted files.
162 public function getWhitelistedFiles(): array
164 return $this->whitelistedFiles;
168 * Sets the whitelisted files.
170 public function setWhitelistedFiles(array $whitelistedFiles): void
172 $this->whitelistedFiles = $whitelistedFiles;
tests (49 usages found)
tests (43 usages found)
CodeCoverageTest.php (2 usages found)
290 $this->coverage->filter()->addDirectoryToWhitelist(TEST_FILES_PATH);
316 $this->coverage->filter()->addDirectoryToWhitelist(TEST_FILES_PATH);
FilterTest.php (41 usages found)
79 * @covers SebastianBergmann\CodeCoverage\Filter::addFileToWhitelist
80 * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
82 public function testAddingAFileToTheWhitelistWorks(): void
84 $this->filter->addFileToWhitelist($this->files[0]);
88 $this->filter->getWhitelist()
93 * @covers SebastianBergmann\CodeCoverage\Filter::removeFileFromWhitelist
94 * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
96 public function testRemovingAFileFromTheWhitelistWorks(): void
98 $this->filter->addFileToWhitelist($this->files[0]);
99 $this->filter->removeFileFromWhitelist($this->files[0]);
101 $this->assertEquals([], $this->filter->getWhitelist());
105 * @covers SebastianBergmann\CodeCoverage\Filter::addDirectoryToWhitelist
106 * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
107 * @depends testAddingAFileToTheWhitelistWorks
109 public function testAddingADirectoryToTheWhitelistWorks(): void
111 $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH);
113 $whitelist = $this->filter->getWhitelist();
114 \sort($whitelist);
116 $this->assertEquals($this->files, $whitelist);
120 * @covers SebastianBergmann\CodeCoverage\Filter::addFilesToWhitelist
121 * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
123 public function testAddingFilesToTheWhitelistWorks(): void
132 $this->filter->addFilesToWhitelist($files);
134 $whitelist = $this->filter->getWhitelist();
135 \sort($whitelist);
137 $this->assertEquals($this->files, $whitelist);
141 * @covers SebastianBergmann\CodeCoverage\Filter::removeDirectoryFromWhitelist
142 * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
143 * @depends testAddingADirectoryToTheWhitelistWorks
145 public function testRemovingADirectoryFromTheWhitelistWorks(): void
147 $this->filter->addDirectoryToWhitelist(TEST_FILES_PATH);
148 $this->filter->removeDirectoryFromWhitelist(TEST_FILES_PATH);
150 $this->assertEquals([], $this->filter->getWhitelist());
170 public function testWhitelistedFileIsNotFiltered(): void
172 $this->filter->addFileToWhitelist($this->files[0]);
179 public function testNotWhitelistedFileIsFiltered(): void
181 $this->filter->addFileToWhitelist($this->files[0]);
200 * @covers SebastianBergmann\CodeCoverage\Filter::addFileToWhitelist
201 * @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
209 $filter->addFileToWhitelist('does_not_exist');
211 $this->assertEmpty($filter->getWhitelistedFiles());
TestCase.php (6 usages found)
93 $filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php');
157 $filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php');
197 $filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php');
299 $filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_ignore.php');
335 $filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php');
376 $filter->addFileToWhitelist(TEST_FILES_PATH . 'Crash.php');
phpunit (101 usages found)
src (101 usages found)
Framework (27 usages found)
MockObject (4 usages found)
Generator.php (4 usages found)
69 private const BLACKLISTED_METHOD_NAMES = [
1063 return !($this->isConstructor($method) || $method->isFinal() || $method->isPrivate() || $this->isMethodNameBlacklisted($method->getName()));
1066 private function isMethodNameBlacklisted(string $name): bool
1068 return isset(self::BLACKLISTED_METHOD_NAMES[$name]);
TestCase.php (20 usages found)
107 use SebastianBergmann\GlobalState\Blacklist;
126 protected $backupGlobalsBlacklist = [];
136 protected $backupStaticAttributesBlacklist = [];
2299 $blacklist = new Blacklist;
2301 foreach ($this->backupGlobalsBlacklist as $globalVariable) {
2302 $blacklist->addGlobalVariable($globalVariable);
2306 $blacklist->addClassNamePrefix('PHPUnit');
2307 $blacklist->addClassNamePrefix('SebastianBergmann\CodeCoverage');
2308 $blacklist->addClassNamePrefix('SebastianBergmann\FileIterator');
2309 $blacklist->addClassNamePrefix('SebastianBergmann\Invoker');
2310 $blacklist->addClassNamePrefix('SebastianBergmann\Timer');
2311 $blacklist->addClassNamePrefix('PHP_Token');
2312 $blacklist->addClassNamePrefix('Symfony');
2313 $blacklist->addClassNamePrefix('Text_Template');
2314 $blacklist->addClassNamePrefix('Doctrine\Instantiator');
2315 $blacklist->addClassNamePrefix('Prophecy');
2316 $blacklist->addStaticAttribute(ComparatorFactory::class, 'instance');
2318 foreach ($this->backupStaticAttributesBlacklist as $class => $attributes) {
2320 $blacklist->addStaticAttribute($class, $attribute);
2326 $blacklist,
TestResult.php (3 usages found)
26 use PHPUnit\Util\Blacklist;
758 $blacklist = new Blacklist;
767 if (!$blacklist->isBlacklisted($function['filename'])) {
TextUI (33 usages found)
Command.php (3 usages found)
176 'whitelist=' => null,
763 case '--whitelist':
764 $this->arguments['whitelist'] = $option[1];
Help.php (1 usage found)
43 ['arg' => '--whitelist <dir>', 'desc' => 'Whitelist <dir> for code coverage analysis'],
TestRunner.php (29 usages found)
484 $whitelistFromConfigurationFile = false;
485 $whitelistFromOption = false;
487 if (isset($arguments['whitelist'])) {
488 $this->codeCoverageFilter->addDirectoryToWhitelist($arguments['whitelist']);
490 $whitelistFromOption = true;
496 if (!empty($filterConfiguration['whitelist'])) {
497 $whitelistFromConfigurationFile = true;
500 if (!empty($filterConfiguration['whitelist'])) {
501 foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) {
502 $this->codeCoverageFilter->addDirectoryToWhitelist(
509 foreach ($filterConfiguration['whitelist']['include']['file'] as $file) {
510 $this->codeCoverageFilter->addFileToWhitelist($file);
513 foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) {
514 $this->codeCoverageFilter->removeDirectoryFromWhitelist(
521 foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) {
522 $this->codeCoverageFilter->removeFileFromWhitelist($file);
540 $codeCoverage->setUnintentionallyCoveredSubclassesWhitelist(
568 if (!empty($filterConfiguration['whitelist'])) {
569 $codeCoverage->setAddUncoveredFilesFromWhitelist(
570 $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist']
573 $codeCoverage->setProcessUncoveredFilesFromWhitelist(
574 $filterConfiguration['whitelist']['processUncoveredFilesFromWhitelist']
578 if (!$this->codeCoverageFilter->hasWhitelist()) {
579 if (!$whitelistFromConfigurationFile && !$whitelistFromOption) {
580 $this->writeMessage('Error', 'No whitelist is configured, no code coverage will be generated.');
582 $this->writeMessage('Error', 'Incorrect whitelist config, no code coverage will be generated.');
600 $script = (new XdebugFilterScriptGenerator)->generate($filterConfiguration['whitelist']);
1239 $arguments['addUncoveredFilesFromWhitelist'] = $arguments['addUncoveredFilesFromWhitelist'] ?? true;
1265 $arguments['processUncoveredFilesFromWhitelist'] = $arguments['processUncoveredFilesFromWhitelist'] ?? false;
Util (41 usages found)
Blacklist.php (5 usages found)
53 final class Blacklist
58 public static $blacklistedClassNames = [
157 public function getBlacklistedDirectories(): array
167 public function isBlacklisted(string $file): bool
192 foreach (self::$blacklistedClassNames as $className => $parent) {
Configuration.php (16 usages found)
176 $addUncoveredFilesFromWhitelist = true;
177 $processUncoveredFilesFromWhitelist = false;
183 $tmp = $this->xpath->query('filter/whitelist');
186 if ($tmp->item(0)->hasAttribute('addUncoveredFilesFromWhitelist')) {
187 $addUncoveredFilesFromWhitelist = $this->getBoolean(
189 'addUncoveredFilesFromWhitelist'
195 if ($tmp->item(0)->hasAttribute('processUncoveredFilesFromWhitelist')) {
196 $processUncoveredFilesFromWhitelist = $this->getBoolean(
198 'processUncoveredFilesFromWhitelist'
205 'filter/whitelist/directory'
209 'filter/whitelist/file'
213 'filter/whitelist/exclude/directory'
217 'filter/whitelist/exclude/file'
222 'whitelist' => [
223 'addUncoveredFilesFromWhitelist' => $addUncoveredFilesFromWhitelist,
224 'processUncoveredFilesFromWhitelist' => $processUncoveredFilesFromWhitelist,
ConfigurationGenerator.php (2 usages found)
40 <whitelist processUncoveredFilesFromWhitelist="true">
42 </whitelist>
Filter.php (8 usages found)
61 $blacklist = new Blacklist;
64 if (self::shouldPrintFrame($frame, $prefix, $blacklist)) {
76 private static function shouldPrintFrame($frame, $prefix, Blacklist $blacklist): bool
93 self::fileIsBlacklisted($file, $blacklist) &&
98 private static function fileIsBlacklisted($file, Blacklist $blacklist): bool
100 return (empty($GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST']) ||
101 !in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'], true)) &&
102 !$blacklist->isBlacklisted($file);
GlobalState.php (7 usages found)
62 $blacklist = new Blacklist;
73 if (!empty($GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST']) &&
74 in_array($file, $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'], true)) {
87 if (!$blacklist->isBlacklisted($file) && is_file($file)) {
150 $blacklist = self::SUPER_GLOBAL_ARRAYS;
151 $blacklist[] = 'GLOBALS';
154 if (!$GLOBALS[$key] instanceof Closure && !in_array($key, $blacklist, true)) {
XdebugFilterScriptGenerator.php (3 usages found)
27 $items = $this->getWhitelistItems($filterData);
49 \\XDEBUG_PATH_WHITELIST,
58 private function getWhitelistItems(array $filterData): array191 Whitelist existing violations, but enable the sniff to prevent
psy (4 usages found)
psysh (4 usages found)
src (4 usages found)
TabCompletion (3 usages found)
Matcher (3 usages found)
ClassNamesMatcher.php (3 usages found)
59 $blacklistedTokens = [
64 case self::hasToken([$blacklistedTokens], $token):
65 case self::hasToken([$blacklistedTokens]200 Whitelist existing violations, $prevToken):
Context.php (1 usage found)
24 // Whitelist a very limited number of command-scope magic variable names.but enable the sniff to prevent
sebastian (77 usages found)210 Whitelist existing violations, but enable the sniff to prevent
global-state (77 usages found)
src (17 usages found)
Blacklist.php (4 usages found)
13 * A blacklist for global state elements that should not be snapshotted.
15 final class Blacklist
81 public function isGlobalVariableBlacklisted(string $variableName): bool
86 public function isStaticAttributeBlacklisted(string $className, string $attributeName): bool
Restorer.php (3 usages found)
53 !$snapshot->blacklist()->isGlobalVariableBlacklisted($key)) {
68 $current = new Snapshot($snapshot->blacklist(), false, false, false, false, true, false, false, false, false);
92 if ($snapshot->blacklist()->isStaticAttributeBlacklisted($className, $name)) {
Snapshot.php (10 usages found)
21 * @var Blacklist
23 private $blacklist;
83 public function __construct(Blacklist $blacklist = null, bool $includeGlobalVariables = true, bool $includeStaticAttributes = true, bool
85 if ($blacklist === null) {
86 $blacklist = new Blacklist;
89 $this->blacklist = $blacklist;
127 public function blacklist(): Blacklist
129 return $this->blacklist;
260 !$this->blacklist->isGlobalVariableBlacklisted($key)) {
295 if ($this->blacklist->isStaticAttributeBlacklisted($className, $name)) {
tests (60 usages found)
_fixture (4 usages found)
BlacklistedChildClass.php (1 usage found)
12 class BlacklistedChildClass extends BlacklistedClass
BlacklistedClass.php (1 usage found)
12 class BlacklistedClass
BlacklistedImplementor.php (1 usage found)
12 class BlacklistedImplementor implements BlacklistedInterface
BlacklistedInterface.php (1 usage found)
12 interface BlacklistedInterface
BlacklistTest.php (38 usages found)
13 use SebastianBergmann\GlobalState\TestFixture\BlacklistedChildClass;
14 use SebastianBergmann\GlobalState\TestFixture\BlacklistedClass;
15 use SebastianBergmann\GlobalState\TestFixture\BlacklistedImplementor;
16 use SebastianBergmann\GlobalState\TestFixture\BlacklistedInterface;
19 * @covers \SebastianBergmann\GlobalState\Blacklist
21 final class BlacklistTest extends TestCase
24 * @var \SebastianBergmann\GlobalState\Blacklist
26 private $blacklist;
30 $this->blacklist = new Blacklist;
33 public function testGlobalVariableThatIsNotBlacklistedIsNotTreatedAsBlacklisted(): void223 Whitelist existing violations, but enable the sniff to prevent
35 $this->assertFalse($this->blacklist->isGlobalVari231 Whitelist existing violations, but enableBlacklisted('variable')); the sniff to prevent
38 public function testGlobalVariableCanBeBlacklisted(): voidHISTORY (119 usages found)
40 $this->222 * (T262364) shell: Don't blacklist->addGlobalVariable('variable'); /run/firejail.
42 $this->assertTrue($this->blacklist->isGlobalVariableBlacklisted('variable'));495 * (T204618) Whitelisted the aria-hidden HTML attribute for all elements in
45 public function testStaticAttributeThatIsNotB606 * Replaced wikimedia/password-blacklistedIsNotTreatedAsBlacklisted(): void 0.1.4 with wikimedia/common-passwords
48 $this->black854 * Sanitizer::setupAttributeWhitelist->isStaticA() and Sanitizer::attributeBlackWhitelisted((),
49 B1004 * The deprecated $blacklistedClass::class,t parameter to wfIsBadImage() has been removed.
1182 55 public function testClassCanBeBlacklisted(): voidand ::setEnableImageWhitelist() have been deprecated. Future parsers
57 $this->blacklist->addClass(1937 $wgPasswordPolicy['policies']['default']['PasswordNotInLargeBlacklistedClass::class);'] = false;
60 $this->b2376 * User::isLocallyBlockedProxy and User::inDnsBlacklist->isStaticAttributeBlacklisted( are deprecated and moved
61 2378 * User::isDnsBlacklistedClass::class,isted is deprecated. Use BlockManager::isDnsBlacklisted
67 public function testSubclassesCanBeBlacklisted(): void2431 * Sanitizer::attributeWhitelist() and Sanitizer::setupAttributeWhitelist()
69 $this->2702 password is not in the large blacklist->addSubclassesOf(BlacklistedClass::class);. This is enabled by default for the
72 $this->blacklist->isStaticAttribut2704 this for other user groups, set the `PasswordNotInLargeBlacklisted(t` flag `true`.
73 BlacklistedChildClass::class,2776 * Added wikimedia/password-blacklist 0.1.4.
79 public function testImplementorsCanB2919 * getSaveBlacklisted(): void()
81 $this->blacklist->addImplementorsOf(BlacklistedInterface::class);3062 follow best practices, it is reccommended to use 'PasswordNotInLargeBlacklist'
84 $this->3063 instead which blacklist->isStaticAttributeBlacklisted(s 100,000 commonly used passwords.
85 B3219 * (T208881) SECURITY: blacklistedImplementor::class, CSS var().
91 public function testClassNamePrefixesCanBeBlacklisted(): void3326 * $wgEnableImageWhitelist is now disabled by default, as it opens up a hole for
93 $this->blacklist->addClassNamePrefix('SebastianBergmann\GlobalState');3328 "MediaWiki:External image whitelist" on your wiki to see whether the feature
96 $this->blacklist->isStaticAttributeBlacklisted(3335 * $wgBrowserBlacklist – This setting, deprecated in 1.30, was removed.
97 B3462 * (T198935) User list preferences such as `email-blacklistedClass::class,` and similar
103 public function testStaticAttributeCanBeB4262 * (T208881) SECURITY: blacklisted(): void CSS var().
105 $this->4822 * (T208881) SECURITY: blacklist->addStaticAttribute( CSS var().
106 4947 $wgEnableUserEmailBlacklistedClass::class, to true.
111 $this->b4948 * (T67297) $wgBrowserBlacklist->isStaticAttributeBlacklisted( is deprecated, and changing it will have no
112 BlacklistedClass::class,5213 The SpamBlacklist and PdfHandler extensions were missing from the generated
RestorerTest.php (1 usage found)5328 * (T48143) SECURITY: Spam blacklist ineffective on encoded URLs inside file
17 * @uses \SebastianBergmann\GlobalState\Blacklist5641 * (T48143) SECURITY: Spam blacklist ineffective on encoded URLs inside file
SnapshotTest.php (17 usages found)6026 * (T208881) SECURITY: blacklist CSS var().
13 use SebastianBergmann\GlobalState\TestFixture\BlacklistedInterface;6150 * (T48143) SECURITY: Spam blacklist ineffective on encoded URLs inside file
20 * @uses \SebastianBergmann\GlobalState\Blacklist6378 * Whitelisted the following HTML attributes for all elements in wikitext:
25 * @var 6419 ** Two new globals, $wgChangeCredentialsBlacklist and
6420 27 private $blacklist;$wgRemoveCredentialsBlacklist can be used to prevent the web UI and the API
31 $this->8572 * (T48143) SECURITY: Spam blacklist = new Blacklist;t ineffective on encoded URLs inside file
38 $this->b8849 * $wgHttpOnlyBlacklistAllLoadedClassesExceptSnapshotClass(); has been removed.
40 $snapshot = new Snapshot($this->blacklist, false, true, false, false, false, false, false, false, false);9417 * (bug 60771) SECURITY: Disallow uploading SVG files using non-whitelisted
54 $snapshot = new Snapshot($this->blacklist, false, false, true, false, false, false, false, false, false);9419 the namespace name if they use a non- whitelisted namespace.
61 $snapshot = new Snapshot($this->black9478 have been whitelist, false, false, false, true, false, false, false, false, false);ed inside of $wgUrlProtocols.
70 $snapshot = new Snapshot($this->blacklist, false, false, false, false, true, false, false, false, false);9538 * (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and
79 $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, true, false, false9669 uploads by URL, false);useful for blacklisting specific URLs
82 $this->assertContains(BlacklistedInterface::class, $interfaces);10062 * (bug 60771) SECURITY: Disallow uploading SVG files using non-whitelisted
90 $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, false, true, false, false);10065 non-whitelisted namespace.
97 $snapshot = new Snapshot($this->blacklist, false, false, false, false, false, false, false, true, false);10164 * The HTML5 <mark> tag has been whitelisted.
106 $snapshot = new Snapshot($this->black10205 * Added $wgWhitelist, false, false, false, false, false, false, false, false, true);ReadRegexp for regex whitelisting.
110 private function blacklistAllLoadedClassesExceptSnapshotClass(): void10459 * BREAKING CHANGE: (bug 38244) Removed the mediawiki.api.titleblacklist module
117 $this->b10460 and moved it to the TitleBlacklist->addClass($class); extension.
squizlabs (34 usages found)10499 * (bug 47304) SECURITY: Check SVG xml encoding against whitelist
php_codesniffer (34 usages found)10680 API upload errors due to the file extension blacklist.
src (34 usages found)10904 * (bug 11142) Improve file extension blacklist error reporting in API upload.
F11079 * (bug 60771) SECURITY: Disallow uploading SVG files (1 usage found)using non-whitelisted
File.php (1 usage found)11081 the namespace name if they use a non- whitelisted namespace.
877 // If it is ignored, make sure it's no11140 * (bug 47304) SECURITY: Check SVG xml encoding against whitelisted.
Filters (33 usages found)11216 * Expanded Blacklist for SVG Files
ExactMatch.php (21 usages found)11240 * (bug 35303) Proxy and DNS blacklist blocking works again
5 * Supports both whitelists11269 * $wgDnsBlacklistUrls now accepts an array with url and blacklists.key as the
24 private $b11644 * Expanded Blacklist = null;for SVG Files
29 * If the white12030 * (bug 18372) File types blacklist is empty, only files in the bed by $wgFileBlacklist will be excluded.no longer be shown
33 private $whitelist = null;12071 extensions is blacklisted now gives the proper extension in the error message.
39 * If a file is both b12503 * Expanded Blacklisted and whitelisted, it will be deemed unacceptable. for SVG Files
49 if ($this->black12746 * (bug 671) The <dfn>, <kbd> and <samp> elements have been whitelist === null) {ed in user
50 $this->blacklist = $this->getblacklist();12817 * Added $wgAllowImageTag, which can be set to true to whitelist the <img> tag
53 if ($this->white13084 * (bug 18372) File types blacklisted by $wgFileBlacklist === null) {will no longer be shown
54 $this->whitelist = $this->getwhitelist();13521 to $wgDnsBlacklistUrls (backward compatibility kept)
59 // If file is both b13530 * $wgEnableSorbs renamed to $wgDnsBlacklisted and whitelisted, the blacklist takes precedence.Urls ($wgEnableSorbs kept for
60 if (isset($this->blacklist[$filePath]) === true) {13712 * Added $wgRateLimitsExcludedIPs, to allow specific IPs to be whitelisted from
64 if (empty($this->whitelist) === true && empty($this->13918 * (bug 19355) Added .xhtml, .xht to upload file extension blacklist) === false) {
65 // We are only checking a blacklist14509 * Added $wgRateLimitsExcludedIPs, so everything else shouldto allow specific IPs to be whitelisted. from
69 return isset($this->whitelist[$filePath]);14833 * Introduced $wgEnableImageWhitelist to toggle the on-wiki external image
77 * Ensures that the blacklist and14834 whitelist are preserved so they don't haveon or off.
85 $children->black14932 * Added an on-wiki external image whitelist = $. Items in this->black whitelist; are
86 $children->whitelist = $this->whitelist;15188 * Blacklist redirects via Special:Filepath, hard to use.
93 * Get a list of blacklisted file paths.15488 * Blacklist redirects via Special:Filepath. Such redirects exacerbate any
97 abstract protected function getBlacklist();15861 * (bug 13905) Blacklist Mac IE from HttpOnly cookies; it eats them sometimes
101 * Get a list of whitelisted file paths.16155 * Blacklist redirects via Special:Filepath. Such redirects exacerbate any XSS
105 abstract protected funct16398 * Fixed notice when accessing special page without read permission getWand whitelist();
GitModified.php (6 usages found)16471 * If restricted read access was enabled, whitelist didn't work with special
19 * Get a list of blacklisted file paths.16937 * (bug 8989) Blacklist 'mhtml' and 'mht' files from upload
23 protected function getB17116 * Add Google Wireless Transcoder to the Unicode editing blacklist()
27 }//end getBlacklist()17190 equivalent to a whitelisted title
31 * Get a list17258 $wgWhitelistRead is undefined, instead of whitelisted file paths.(incorrectly) honouring them
35 protected fun17259 * Fixed img_auth.php file name extraction getWfor whitelist() checking
63 }//end getWhitelist()17949 * (bug 7629) Fix $wgBrowserBlackList to avoid false positive on MSIE
GitStaged.php (6 usages found)18419 * (bug 7883) Added autoblock whitelisting feature, using which specific ranges
21 * Get a list of blacklisted file paths18421 format, in the autoblock_whitelist system message.
25 protected function getBlacklist()18597 A more thorough blacklist for forbidden and translatable characters would
29 }//end getB18913 The base hostname for the DNS-based proxy blacklist() can now be overridden
33 * Get a list of whitelisted file paths18914 when $wgEnableSorbs is set, to use a different blacklist instead of SORBS.
37 protected function getWhitelist()18915 The blacklist would need to respond the same was as SORBS; any positive
65 }//end getWhitelist()19110 to break the blacklists for regular URLs
wikimedia (26 usages found)19345 * (bug 7537) Add php5 to $wgFileBlacklist
composer-merge-plugin (1 usage found)19627 * Pass login link to "whitelistedittext" containing 'returnto' parameter
src (1 usage found)20558 * [[meta:SpamBlacklist extension|SpamBlacklist extension]] now has support for
MergePlugin.php (1 usage found)20872 * Blacklist additional MSIE CSS safety tricks
372 $installer->setUpdateWhitelist($requirements);20891 MIME type to the default blacklist. Prevented inline display of images
parsoid (18 usages found)21043 * Recognize Special:Search consistently so read whitelist works
src (18 usages found)21348 spam-cleanup tool in the SpamBlacklist extension.
Core (17 usages found)21589 If .svg files are added to the upload whitelist, you can choose to render
Sanitizer.php (17 usages found)21912 * (bug 2152) Add missing bgcolor to attribute whitelist for <td> and <th>
71 * Blacklist for evil uris like javascript:21952 * Only build the HTML attribute whitelist tree once.
72 * WARNING: DO NOT use this in any 22001 * (bug 873) Fix usage of createaccount permission; replace that actually requires blacklistings $wgWhitelistAccount
73 * for security reasons. There are NUMEROUS[1] ways to bypass blacklisting,22042 * (bug 996) Replace $wgWhitelistEdit with 'edit' permission; thefixup UPGRADE
74 * only way to be secure from javascript: uri based xss vectors is to22043 documentation about edit and read whitelists.
98 * Strip them before further processing so22266 for browsers that hit the Unicode blacklists and such work. Patch by plugwash.
129 * Fetch the white22361 * Blacklist of acceptable attributes for a given element name.additional MSIE CSS safety tricks
134 public static function attributeWhitelist( string $element ): array {22414 * Recognize Special:Search consistently so read whitelist works
136 $22443 MIME type to the default blacklists = self::setupAttributeWhitelist();. Prevented inline display of images
146 private static function setupAttributeWhitelist(): array {22559 that browser. This release blacklists several additional variants from use in
147 static $whitelist;22905 * (bug 996) Fix $wgWhitelistRead to work again
149 if ( $whitelist !== null ) {22918 * Enhance upload extension blacklist to protect against vulnerable
150 return $22940 * Add the dreaded <span> to the HTML whitelist;
207 $23059 * Removed .ogg from the default uploads whitelist = [as an extra precaution.
301 # whitelist is used from the Parser object23151 * (bug 1147) add \checkmark to whitelist in texutil.ml
368 return $whitelist;23268 blacklists several additional variants from use in HTML inline style
857 $wlist = self::attributeW23399 * Removed .ogg from the default uploads whitelist( $tag ); as an extra precaution. If
890 // Bypass RDFa/white23424 * Enhance upload extension blacklisting checks for Parsoid-inserted attrs to protect against vulnerable Apache
Ext (1 usage found)23453 * ({{bugzilla|874}}) added 'cgi' to {{wg|FileBlacklist}}
Gallery (1 usage found)23504 have expanded the <code>filetype</code> whitelist or disabled the strict type
Opts.php (1 usage found)23522 enabled if in {{wg|WhitelistEdit}} mode.
48 $validUlAttrs = Sanitizer::attributeWhitelist( 'ul' );23578 * {{wg|WhitelistAccount}} no longer breaks all logins.
shellbox (7img_auth.php (1 usages found)
src (7 usages found)168 // Checks Whitelist too
Command (7phpunit.xml.dist (2 usages found)
FirejailWrapper.php (7 usages found)48 <whitelist addUncoveredFilesFromWhitelist="false">
58 $62 </whitelistedPaths = $command->getAllowedPaths();t>
59 // Whitelist our own sourcesRELEASE-NOTES-1.36 (7 usages found)
60 $19 * MediaWiki:Autoblock_whitelistedPaths[] = dirname( __DIR__ ); has been moved to
62 foreach ( $command->getAllowedPaths() as $21 the MediaWiki:Autoblock_whitelistedPath ) { page.
63 if ( $whitelistedPath === '/home' ) {88 * The deprecated password policies PasswordCannotMatchBlacklist and
66 $cmd[] = "--whitelist={$whitelistedPath}";89 PasswordNotInLargeBlacklist were removed. Please use
71 $cmd[] = '--b357 - ::isDnsBlacklist=' . $path;ted
img_auth.php (1 usage found) 358 - ::inDnsBlacklist
168 // Checks 742 * DatabaseBlock::isWhitelist tooedFromAutoblocks was deprecated. Use
```