Use more neutral or alternative language

Bug: T277987
Change-Id: Iafc4b3e3137936046487119b7e17635f4e560277
This commit is contained in:
Reedy 2021-03-19 18:36:44 +00:00 committed by Jforrester
parent ef0e5d4825
commit cce3fb49d0
16 changed files with 34 additions and 37 deletions

View file

@ -1069,8 +1069,8 @@ $wgFileExtensions = [ 'png', 'gif', 'jpg', 'jpeg', 'webp' ];
/**
* Files with these extensions will never be allowed as uploads.
* An array of file extensions to blacklist. You should append to this array
* if you want to blacklist additional files.
* An array of file extensions to prevent being uploaded. You should
* append to this array if you want to prevent additional file extensions.
*/
$wgFileBlacklist = [
# HTML may contain cookie-stealing JavaScript and web bugs

View file

@ -775,7 +775,7 @@ function wfUrlProtocolsWithoutProtRel() {
* 1) Handles protocols that don't use :// (e.g., mailto: and news:, as well as
* protocol-relative URLs) correctly.
* 2) Adds a "delimiter" element to the array (see (2)).
* 3) Verifies that the protocol is on the $wgUrlProtocols whitelist.
* 3) Verifies that the protocol is on the $wgUrlProtocols allowed list.
* 4) Rejects some invalid URLs that parse_url doesn't, e.g. the empty string or URLs starting with
* a line feed character.
*

View file

@ -568,23 +568,23 @@ class PermissionManager {
$title = Title::newFromLinkTarget( $page );
$whiteListRead = $this->options->get( 'WhitelistRead' );
$whitelisted = false;
$allowed = false;
if ( $this->isEveryoneAllowed( 'read' ) ) {
# Shortcut for public wikis, allows skipping quite a bit of code
$whitelisted = true;
$allowed = true;
} elseif ( $this->userHasRight( $user, 'read' ) ) {
# If the user is allowed to read pages, he is allowed to read all pages
$whitelisted = true;
$allowed = true;
} elseif ( $this->isSameSpecialPage( 'Userlogin', $title )
|| $this->isSameSpecialPage( 'PasswordReset', $title )
|| $this->isSameSpecialPage( 'Userlogout', $title )
) {
# Always grant access to the login page.
# Even anons need to be able to log in.
$whitelisted = true;
$allowed = true;
} elseif ( $this->isSameSpecialPage( 'RunJobs', $title ) ) {
# relies on HMAC key signature alone
$whitelisted = true;
$allowed = true;
} elseif ( is_array( $whiteListRead ) && count( $whiteListRead ) ) {
# Time to check the whitelist
# Only do these checks is there's something to check against
@ -594,12 +594,12 @@ class PermissionManager {
// Check for explicit whitelisting with and without underscores
if ( in_array( $name, $whiteListRead, true )
|| in_array( $dbName, $whiteListRead, true ) ) {
$whitelisted = true;
$allowed = true;
} elseif ( $title->getNamespace() === NS_MAIN ) {
# Old settings might have the title prefixed with
# a colon for main-namespace pages
if ( in_array( ':' . $name, $whiteListRead ) ) {
$whitelisted = true;
$allowed = true;
}
} elseif ( $title->isSpecialPage() ) {
# If it's a special page, ditch the subpage bit and check again
@ -609,29 +609,29 @@ class PermissionManager {
if ( $name ) {
$pure = SpecialPage::getTitleFor( $name )->getPrefixedText();
if ( in_array( $pure, $whiteListRead, true ) ) {
$whitelisted = true;
$allowed = true;
}
}
}
}
$whitelistReadRegexp = $this->options->get( 'WhitelistReadRegexp' );
if ( !$whitelisted && is_array( $whitelistReadRegexp )
if ( !$allowed && is_array( $whitelistReadRegexp )
&& !empty( $whitelistReadRegexp ) ) {
$name = $title->getPrefixedText();
// Check for regex whitelisting
foreach ( $whitelistReadRegexp as $listItem ) {
if ( preg_match( $listItem, $name ) ) {
$whitelisted = true;
$allowed = true;
break;
}
}
}
if ( !$whitelisted ) {
if ( !$allowed ) {
# If the title is not whitelisted, give extensions a chance to do so...
$this->hookRunner->onTitleReadWhitelist( $title, $user, $whitelisted );
if ( !$whitelisted ) {
$this->hookRunner->onTitleReadWhitelist( $title, $user, $allowed );
if ( !$allowed ) {
$errors[] = $this->missingPermissionError( $action, $short );
}
}

View file

@ -72,7 +72,7 @@ class ProxyLookup {
/**
* Checks if an IP is a trusted proxy provider.
* Useful to tell if X-Forwarded-For data is possibly bogus.
* CDN cache servers for the site are whitelisted.
* CDN cache servers for the site are allowed.
*
* @param string $ip
* @return bool

View file

@ -66,7 +66,7 @@ class StreamFile {
* Determine the file type of a file based on the path
*
* @param string $filename Storage path or file system path
* @param bool $safe Whether to do retroactive upload blacklist checks
* @param bool $safe Whether to do retroactive upload prevention checks
* @return null|string
*/
public static function contentTypeFromPath( $filename, $safe = true ) {

View file

@ -752,7 +752,7 @@ class MessageCache implements LoggerAwareInterface {
// Update the process cache
$this->cache->set( $code, $cache );
// Pre-emptively update the local datacenter cache so things like edit filter and
// blacklist changes are reflected immediately; these often use MediaWiki: pages.
// prevented changes are reflected immediately; these often use MediaWiki: pages.
// The datacenter handling replace() calls should be the same one handling edits
// as they require HTTP POST.
$this->saveToCaches( $cache, 'all', $code );

View file

@ -236,7 +236,7 @@ class JobQueueFederated extends JobQueue {
$this->logException( $e );
}
if ( !$ok ) {
if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) { // blacklist
if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) {
throw new JobQueueError( "Could not insert job(s), no partitions available." );
}
$jobsLeft = array_merge( $jobsLeft, $jobBatch ); // not inserted
@ -255,7 +255,7 @@ class JobQueueFederated extends JobQueue {
$this->logException( $e );
}
if ( !$ok ) {
if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) { // blacklist
if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) {
throw new JobQueueError( "Could not insert job(s), no partitions available." );
}
$jobsLeft = array_merge( $jobsLeft, $jobBatch ); // not inserted

View file

@ -621,7 +621,7 @@ class Exif {
}
if ( preg_match( "/[^\x0a\x20-\x7e]/", $in ) ) {
$this->debug( $in, __FUNCTION__, 'found a character not in our whitelist' );
$this->debug( $in, __FUNCTION__, 'found a character that is not allowed' );
return false;
}

View file

@ -702,8 +702,8 @@ abstract class IndexPager extends ContextSource implements Pager {
/**
* Get an array of query parameters that should be put into self-links.
* By default, all parameters passed in the URL are used, except for a
* short blacklist.
* By default, all parameters passed in the URL are used, apart from a
* few exceptions.
*
* @stable to override
*

View file

@ -275,11 +275,9 @@ class DateFormatter {
$isoBits[] = $match['isoDay'];
$isoDate = implode( '-', $isoBits );
// Output is not strictly HTML (it's wikitext), but <span> is whitelisted.
$text = Html::rawElement( 'span',
// Output is not strictly HTML (it's wikitext), but <span> is allowed.
return Html::rawElement( 'span',
[ 'class' => 'mw-formatted-date', 'title' => $isoDate ], $text );
return $text;
}, $text
);
}

View file

@ -38,7 +38,7 @@
* extension can be installed via PECL or your operating system's package manager.
*
* To restrict the functions for which profiling data is collected, you can
* use either a whitelist ($wgProfiler['include']) or a blacklist
* use either a allow list ($wgProfiler['include']) or a deny list
* ($wgProfiler['exclude']) containing an array of function names.
* Shell-style patterns are also accepted.
*

View file

@ -59,12 +59,11 @@ class SpecialShortPages extends QueryPage {
public function getQueryInfo() {
$config = $this->getConfig();
$blacklist = $config->get( 'ShortPagesNamespaceBlacklist' );
$tables = [ 'page' ];
$conds = [
'page_namespace' => array_diff(
$this->namespaceInfo->getContentNamespaces(),
$blacklist
$config->get( 'ShortPagesNamespaceBlacklist' )
),
'page_is_redirect' => 0
];

View file

@ -261,7 +261,7 @@ class UploadForm extends HTMLForm {
"</div>\n";
} else {
# We have to list both preferred and prohibited
$fileBlacklist = array_unique( $config->get( 'FileBlacklist' ) );
$prohibitedExtensions = array_unique( $config->get( 'FileBlacklist' ) );
$extensionsList =
'<div id="mw-upload-preferred">' .
$this->msg( 'upload-preferred' )
@ -271,8 +271,8 @@ class UploadForm extends HTMLForm {
"</div>\n" .
'<div id="mw-upload-prohibited">' .
$this->msg( 'upload-prohibited' )
->params( $this->getLanguage()->commaList( $fileBlacklist ) )
->numParams( count( $fileBlacklist ) )
->params( $this->getLanguage()->commaList( $prohibitedExtensions ) )
->numParams( count( $prohibitedExtensions ) )
->parseAsBlock() .
"</div>\n";
}

View file

@ -1101,7 +1101,7 @@ class User implements Authority, IDBAccessObject, UserIdentity {
* either by batch processes or by user accounts which have
* already been created.
*
* Additional blacklisting may be added here rather than in
* Additional preventions may be added here rather than in
* isValidUserName() to avoid disrupting existing accounts.
*
* @deprecated since 1.35, use the UserNameUtils service

View file

@ -210,7 +210,7 @@ class UserNameUtils implements UserRigorOptions {
* either by batch processes or by user accounts which have
* already been created.
*
* Additional blacklisting may be added here rather than in
* Additional preventions may be added here rather than in
* isValidUserName() to avoid disrupting existing accounts.
*
* @param string $name String to match

View file

@ -106,7 +106,7 @@ class UserNameUtilsTest extends MediaWikiIntegrationTestCase {
'Looks too much like an IPv4 address (1)' => [ '300.300.300.300', false ],
'Looks too much like an IPv4 address (2)' => [ '302.113.311.900', false ],
'Reserved for usage by UseMod for cloaked logged-out users' => [ '203.0.113.xxx', false ],
'Blacklisted characters' => [ "\u{E000}", false ],
'Disallowed characters' => [ "\u{E000}", false ],
];
}