Skip to content

Commit

Permalink
MDL-69050 lang: Improve the wording of the comments
Browse files Browse the repository at this point in the history
Stop using the terms whitelist/blacklist when used to allow/deny things.
  • Loading branch information
mudrd8mz committed Sep 24, 2020
1 parent e2d54e6 commit 801ee23
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
6 changes: 4 additions & 2 deletions admin/webservice/testclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
}

// whitelisting security
// Allow only functions available for testing.
if (!isset($functions[$function])) {
$function = '';
}
Expand All @@ -81,7 +81,9 @@
}
$protocols[$p] = get_string('pluginname', 'webservice_'.$p);
}
if (!isset($protocols[$protocol])) { // whitelisting security

// Allow only protocols supporting the test client.
if (!isset($protocols[$protocol])) {
$protocol = '';
}

Expand Down
2 changes: 1 addition & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3257,7 +3257,7 @@ function calendar_get_calendar_context($subscription) {
}

/**
* Implements callback user_preferences, whitelists preferences that users are allowed to update directly
* Implements callback user_preferences, lists preferences that users are allowed to update directly
*
* Used in {@see core_user::fill_preferences_cache()}, see also {@see useredit_update_user_preference()}
*
Expand Down
3 changes: 2 additions & 1 deletion filter/algebra/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ public function filter($text, array $options = array()){
$texexp = preg_replace('/\\\int\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\int_'. "{\$2}^{\$3}\$1 ",$texexp);
$texexp = preg_replace('/\\\int\\\left\((.+?d[a-z])\\\right\)/s','\int '. "\$1 ",$texexp);
$texexp = preg_replace('/\\\lim\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\lim_'. "{\$2\\to \$3}\$1 ",$texexp);
$texexp = str_replace('\mbox', '', $texexp); // now blacklisted in tex, sorry
// Remove a forbidden keyword.
$texexp = str_replace('\mbox', '', $texexp);
$texcache = new stdClass();
$texcache->filter = 'algebra';
$texcache->version = 1;
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ protected static function load_classes($component, $fulldir, $namespace = '') {
/**
* List all core subsystems and their location
*
* This is a whitelist of components that are part of the core and their
* This is a list of components that are part of the core and their
* language strings are defined in /lang/en/<<subsystem>>.php. If a given
* plugin is not listed here and it does not have proper plugintype prefix,
* then it is considered as course activity module.
Expand Down
2 changes: 1 addition & 1 deletion lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function events_trigger() {
/**
* List all core subsystems and their location
*
* This is a whitelist of components that are part of the core and their
* This is a list of components that are part of the core and their
* language strings are defined in /lang/en/<<subsystem>>.php. If a given
* plugin is not listed here and it does not have proper plugintype prefix,
* then it is considered as course activity module.
Expand Down
1 change: 0 additions & 1 deletion lib/enrollib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,6 @@ function enrol_selfenrol_available($courseid) {
continue;
}
if ($instance->enrol === 'guest') {
// blacklist known temporary guest plugins
continue;
}
if ($plugins[$instance->enrol]->show_enrolme_link($instance)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ function external_generate_token_for_current_user($service) {
$unsettoken = true;
}

// Remove token if its ip not in whitelist.
// Remove token if its IP is restricted.
if (isset($token->iprestriction) and !address_in_subnet(getremoteaddr(), $token->iprestriction)) {
$unsettoken = true;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/filelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3571,7 +3571,7 @@ public static function mock_response($response) {
* @return bool
*/
protected function request($url, $options = array()) {
// Reset here so that the data is valid when result returned from cache, or if we return due to a blacklist hit.
// Reset here so that the data is valid when result returned from cache, or if we return due to a blocked URL hit.
$this->reset_request_state_vars();

if ((defined('PHPUNIT_TEST') && PHPUNIT_TEST)) {
Expand All @@ -3581,8 +3581,8 @@ protected function request($url, $options = array()) {
}
}

// If curl security is enabled, check the URL against the blacklist before calling curl_exec.
// Note: This will only check the base url. In the case of redirects, the blacklist is also after the curl_exec.
// If curl security is enabled, check the URL against the list of blocked URLs before calling curl_exec.
// Note: This will only check the base url. In the case of redirects, the blocking check is also after the curl_exec.
if (!$this->ignoresecurity && $this->securityhelper->url_is_blocked($url)) {
$this->error = $this->securityhelper->get_blocked_url_string();
return $this->error;
Expand All @@ -3605,7 +3605,7 @@ protected function request($url, $options = array()) {
$this->errno = curl_errno($curl);
// Note: $this->response and $this->rawresponse are filled by $hits->formatHeader callback.

// In the case of redirects (which curl blindly follows), check the post-redirect URL against the blacklist entries too.
// In the case of redirects (which curl blindly follows), check the post-redirect URL against the list of blocked list too.
if (intval($this->info['redirect_count']) > 0 && !$this->ignoresecurity
&& $this->securityhelper->url_is_blocked($this->info['url'])) {
$this->reset_request_state_vars();
Expand Down
2 changes: 1 addition & 1 deletion message/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ function core_message_can_edit_message_profile($user) {
}

/**
* Implements callback user_preferences, whitelists preferences that users are allowed to update directly
* Implements callback user_preferences, lists preferences that users are allowed to update directly
*
* Used in {@see core_user::fill_preferences_cache()}, see also {@see useredit_update_user_preference()}
*
Expand Down
2 changes: 1 addition & 1 deletion user/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function useredit_load_preferences(&$user, $reload=true) {
* Updates the user preferences for the given user
*
* Only preference that can be updated directly will be updated here. This method is called from various WS
* updating users and should be used when updating user details. Plugins may whitelist preferences that can
* updating users and should be used when updating user details. Plugins may list preferences that can
* be updated by defining 'user_preferences' callback, {@see core_user::fill_preferences_cache()}
*
* Some parts of code may use user preference table to store internal data, in these cases it is acceptable
Expand Down

0 comments on commit 801ee23

Please sign in to comment.