Skip to content
Snippets Groups Projects
Commit bf1764a9 authored by Derek Wright's avatar Derek Wright
Browse files

Issue #3216612 by guilhermevp, dww, mark_fullmer: Remove usage of "whitelist",...

Issue #3216612 by guilhermevp, dww, mark_fullmer: Remove usage of "whitelist", use better terms instead

(cherry picked from commit 3b9701e4)
parent 75aea372
No related branches found
No related tags found
No related merge requests found
scheme_whitelist: ['http', 'https', 'files', 'internal']
scheme_allow_list: ['http', 'https', 'files', 'internal']
protocol_style: 'full'
local_paths: ''
pathologic.settings:
type: config_object
mapping:
scheme_whitelist:
scheme_allow_list:
type: sequence
label: 'Scheme whitelist'
label: 'Scheme allow list'
sequence:
- type: string
label: 'Scheme'
......
......@@ -161,7 +161,7 @@ function _pathologic_replace($matches) {
// @see http://drupal.org/node/1834308
// Default value is ['http', 'https', 'files', 'internal']
// "files" and "internal" are for Path Filter compatibility.
&& !in_array($parts['scheme'], \Drupal::config('pathologic.settings')->get('scheme_whitelist') ?? [])
&& !in_array($parts['scheme'], \Drupal::config('pathologic.settings')->get('scheme_allow_list') ?? [])
)
// Bail out if it looks like there's only a fragment part.
|| (isset($parts['fragment']) && count($parts) === 1)
......
<?php
/**
* @file
* Post update functions for the Pathologic module.
*/
/**
* Move setting for allowed schemes to a new name (#3216612).
*/
function pathologic_post_update_rename_scheme_allow_list() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('pathologic.settings');
$existing_schema = $config->get('scheme_whitelist');
$config->set('scheme_allow_list', $existing_schema);
$config->clear('scheme_whitelist');
$config->save();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment