--- filter_variables_cmi-1799440-32.patch 2012-11-06 08:00:46.000000000 +0100 +++ filter_variables_cmi-1799440-36.patch 2012-11-06 11:55:50.000000000 +0100 @@ -1,13 +1,16 @@ diff --git a/core/includes/common.inc b/core/includes/common.inc -index 540f42b..815bb77 100644 +index fdfa9e2..48c931a 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc -@@ -1295,7 +1295,7 @@ function drupal_strip_dangerous_protocols($uri) { +@@ -1295,7 +1295,10 @@ function drupal_strip_dangerous_protocols($uri) { static $allowed_protocols; if (!isset($allowed_protocols)) { - $allowed_protocols = array_flip(variable_get('filter_allowed_protocols', array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'tel', 'telnet', 'webcal'))); -+ $allowed_protocols = array_flip(config('system.filter')->get('protocols')); ++ // During test-setup system.filter.protocols may be empty. In order to ++ // avoid test breakage, a list of protocols necessary to run tests is ++ // supplied in that case. ++ $allowed_protocols = array_flip(config('system.filter')->get('protocols') ?: array('http', 'https')); } // Iteratively remove any invalid protocol found. @@ -87,19 +90,6 @@ ' https://example.com, ftp://ftp.example.com, -diff --git a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php -index 506fed2..1040a15 100644 ---- a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php -+++ b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php -@@ -68,6 +68,8 @@ protected function setUp() { - // Set user agent to be consistent with WebTestBase. - $_SERVER['HTTP_USER_AGENT'] = $this->databasePrefix; - -+ config('system.filter')->set('protocols', array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal', 'rtsp'))->save(); -+ - $this->setup = TRUE; - } - } diff --git a/core/modules/system/config/system.filter.yml b/core/modules/system/config/system.filter.yml new file mode 100644 index 0000000..3bfbd9a @@ -120,7 +110,7 @@ + - webcal + - rtsp diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php -index e3cb1d0..75a9a6e 100644 +index e3cb1d0..bf8321d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php @@ -79,6 +79,15 @@ public function testVariableUpgrade() { @@ -128,8 +118,8 @@ ); + $expected_config['system.filter'] = array( -+ 'protocols.0' => 'gopher', -+ 'protocols.1' => 'finger', ++ 'protocols.0' => 'http', ++ 'protocols.1' => 'https', + ); + + $expected_config['filter.settings'] = array( @@ -139,20 +129,6 @@ foreach ($expected_config as $file => $values) { $config = config($file); $this->verbose(print_r($config->get(), TRUE)); -diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php -index 21998e2..f03d663 100644 ---- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php -+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php -@@ -134,6 +134,9 @@ protected function setUp() { - $this->variable_set('site_mail', 'simpletest@example.com'); - - drupal_set_time_limit($this->timeLimit); -+ -+ config('system.filter')->set('protocols', array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal', 'rtsp'))->save(); -+ - $this->setup = TRUE; - } - diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 5a96500..ce0e629 100644 --- a/core/modules/system/system.install @@ -180,22 +156,20 @@ * The next series of updates should start at 9000. */ diff --git a/core/modules/system/tests/upgrade/drupal-7.system.database.php b/core/modules/system/tests/upgrade/drupal-7.system.database.php -index e9f31d3..ce5ab7e 100644 +index e9f31d3..46cd25c 100644 --- a/core/modules/system/tests/upgrade/drupal-7.system.database.php +++ b/core/modules/system/tests/upgrade/drupal-7.system.database.php -@@ -94,7 +94,11 @@ +@@ -94,6 +94,10 @@ ->values(array( 'name' => 'user_cancel_method', 'value' => 's:20:"user_cancel_reassign"', --)) + )) +->values(array( + 'name' => 'filter_allowed_protocols', -+ 'value' => 'a:2:{i:0;s:6:"gopher";i:1;s:6:"finger";}', -+ )) ++ 'value' => 'a:2:{i:0;s:4:"http";i:1;s:5:"https";}', + )) ->execute(); - db_update('variable') @@ -105,4 +109,8 @@ ->fields(array('value' => 's:22:"Testing config upgrade";')) ->condition('name', 'site_name')