diff --git a/core/includes/file.inc b/core/includes/file.inc index 545fca3..815afdc 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -1309,17 +1309,14 @@ function file_get_mimetype($uri, $mapping = NULL) { */ function drupal_chmod($uri, $mode = NULL) { if (!isset($mode)) { - // Configuration system stores default modes as strings. We use octdec() so - // that the octal permission numbers can be expressed as integers or strings - // and will be converted correctly in both cases. if (is_dir($uri)) { - $mode = octdec(\Drupal::config('system.file')->get('chmod.directory')); + $mode = \Drupal::config('system.file')->get('chmod.directory'); if (!$mode) { $mode = 0775; } } else { - $mode = octdec(\Drupal::config('system.file')->get('chmod.file')); + $mode = \Drupal::config('system.file')->get('chmod.file'); if (!$mode) { $mode = 0664; } @@ -1497,7 +1494,7 @@ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) { $mode = FALSE; // During early update there's no container. if (is_object(\Drupal::getContainer())) { - $mode = octdec(\Drupal::config('system.file')->get('chmod.directory')); + $mode = \Drupal::config('system.file')->get('chmod.directory'); } if (!$mode) { $mode = 0775; diff --git a/core/modules/system/config/system.date.yml b/core/modules/system/config/system.date.yml index 29889df..6470af2 100644 --- a/core/modules/system/config/system.date.yml +++ b/core/modules/system/config/system.date.yml @@ -4,6 +4,6 @@ first_day: 0 timezone: default: '' user: - configurable: '1' - warn: '0' - default: '0' + configurable: true + warn: false + default: 0 diff --git a/core/modules/system/config/system.file.yml b/core/modules/system/config/system.file.yml index b5be48c..5d3ae38 100644 --- a/core/modules/system/config/system.file.yml +++ b/core/modules/system/config/system.file.yml @@ -1,8 +1,8 @@ -allow_insecure_uploads: '0' +allow_insecure_uploads: false # chmod variables should be a string in PHP Octal Notation. chmod: - directory: '0775' - file: '0664' + directory: 0775 + file: 0664 default_scheme: 'public' path: private: '' diff --git a/core/modules/system/config/system.image.gd.yml b/core/modules/system/config/system.image.gd.yml index fbc379f..342e071 100644 --- a/core/modules/system/config/system.image.gd.yml +++ b/core/modules/system/config/system.image.gd.yml @@ -1 +1 @@ -jpeg_quality: '75' +jpeg_quality: 75 diff --git a/core/modules/system/config/system.module.yml b/core/modules/system/config/system.module.yml index 696bedc..9ec80e1 100644 --- a/core/modules/system/config/system.module.yml +++ b/core/modules/system/config/system.module.yml @@ -1,2 +1,2 @@ enabled: - system: '0' + system: 0 diff --git a/core/modules/system/config/system.performance.yml b/core/modules/system/config/system.performance.yml index 67e82cf..9957bef 100644 --- a/core/modules/system/config/system.performance.yml +++ b/core/modules/system/config/system.performance.yml @@ -1,6 +1,6 @@ cache: page: - use_internal: '0' + use_internal: false max_age: 0 css: preprocess: false diff --git a/core/modules/system/config/system.theme.global.yml b/core/modules/system/config/system.theme.global.yml index 2d5bc35..13036bf 100644 --- a/core/modules/system/config/system.theme.global.yml +++ b/core/modules/system/config/system.theme.global.yml @@ -2,18 +2,18 @@ favicon: mimetype: image/vnd.microsoft.icon path: '' url: '' - use_default: '1' + use_default: true features: - comment_user_picture: '1' - comment_user_verification: '1' - favicon: '1' - logo: '1' - name: '1' - node_user_picture: '1' - main_menu: '1' - secondary_menu: '1' - slogan: '1' + comment_user_picture: true + comment_user_verification: true + favicon: true + logo: true + name: true + node_user_picture: true + main_menu: true + secondary_menu: true + slogan: true logo: path: '' url: '' - use_default: '1' + use_default: true diff --git a/core/modules/system/config/system.theme.yml b/core/modules/system/config/system.theme.yml index c56c7f2..e88d701 100644 --- a/core/modules/system/config/system.theme.yml +++ b/core/modules/system/config/system.theme.yml @@ -1,4 +1,4 @@ -admin: '0' +admin: '' enabled: - stark: '0' + stark: 0 default: stark diff --git a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php index 7fd19c5..eef3373 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php @@ -89,7 +89,7 @@ function testFileCheckDirectoryHandling() { } // Test that the directory has the correct permissions. - $this->assertDirectoryPermissions($directory, octdec(\Drupal::config('system.file')->get('chmod.directory'))); + $this->assertDirectoryPermissions($directory, \Drupal::config('system.file')->get('chmod.directory')); // Remove .htaccess file to then test that it gets re-created. @drupal_unlink(file_default_scheme() . '://.htaccess'); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php b/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php index 540c19a..30973ad 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/FileTestBase.php @@ -82,11 +82,6 @@ function assertSameFile(FileInterface $file1, FileInterface $file2) { * Optional message. */ function assertFilePermissions($filepath, $expected_mode, $message = NULL) { - // Configuration system stores default modes as strings. - if (is_string($expected_mode)) { - // Convert string to octal. - $expected_mode = octdec($expected_mode); - } // Clear out PHP's file stat cache to be sure we see the current value. clearstatcache(TRUE, $filepath); @@ -122,11 +117,6 @@ function assertFilePermissions($filepath, $expected_mode, $message = NULL) { * Optional message. */ function assertDirectoryPermissions($directory, $expected_mode, $message = NULL) { - // Configuration system stores default modes as strings. - if (is_string($expected_mode)) { - // Convert string to octal. - $expected_mode = octdec($expected_mode); - } // Clear out PHP's file stat cache to be sure we see the current value. clearstatcache(TRUE, $directory); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php index 70f1903..b9e4308 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php @@ -34,7 +34,7 @@ function testNormal() { $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.'); $this->assertTrue(file_exists($uri), 'Original file remains.'); $this->assertTrue(file_exists($new_filepath), 'New file exists.'); - $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); + $this->assertFilePermissions($new_filepath, $config->get('chmod.file')); // Copying with rename. $desired_filepath = 'public://' . $this->randomName(); @@ -44,7 +44,7 @@ function testNormal() { $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); $this->assertTrue(file_exists($uri), 'Original file remains.'); $this->assertTrue(file_exists($newer_filepath), 'New file exists.'); - $this->assertFilePermissions($newer_filepath, octdec($config->get('chmod.file'))); + $this->assertFilePermissions($newer_filepath, $config->get('chmod.file')); // TODO: test copying to a directory (rather than full directory/file path) // TODO: test copying normal files using normal paths (rather than only streams) @@ -75,7 +75,7 @@ function testOverwriteSelf() { $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); - $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); + $this->assertFilePermissions($new_filepath, $config->get('chmod.file')); // Copy the file onto itself without renaming fails. $new_filepath = file_unmanaged_copy($uri, $uri, FILE_EXISTS_ERROR); @@ -93,6 +93,6 @@ function testOverwriteSelf() { $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); $this->assertTrue(file_exists($uri), 'Original file exists after copying onto itself.'); $this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.'); - $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); + $this->assertFilePermissions($new_filepath, $config->get('chmod.file')); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php index 1503bd1..5901a9d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php @@ -34,7 +34,7 @@ function testNormal() { $this->assertEqual($new_filepath, $desired_filepath, 'Returned expected filepath.'); $this->assertTrue(file_exists($new_filepath), 'File exists at the new location.'); $this->assertFalse(file_exists($uri), 'No file remains at the old location.'); - $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); + $this->assertFilePermissions($new_filepath, $config->get('chmod.file')); // Moving with rename. $desired_filepath = 'public://' . $this->randomName(); @@ -45,7 +45,7 @@ function testNormal() { $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); $this->assertTrue(file_exists($newer_filepath), 'File exists at the new location.'); $this->assertFalse(file_exists($new_filepath), 'No file remains at the old location.'); - $this->assertFilePermissions($newer_filepath, octdec($config->get('chmod.file'))); + $this->assertFilePermissions($newer_filepath, $config->get('chmod.file')); // TODO: test moving to a directory (rather than full directory/file path) // TODO: test creating and moving normal files (rather than streams) diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php index 043ed6c..1b03d13 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php @@ -36,6 +36,6 @@ function testFileSaveData() { $this->assertTrue($filepath, 'Unnamed file saved correctly.'); $this->assertEqual('asdf.txt', drupal_basename($filepath), 'File was named correctly.'); $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.'); - $this->assertFilePermissions($filepath, octdec(\Drupal::config('system.file')->get('chmod.file'))); + $this->assertFilePermissions($filepath, \Drupal::config('system.file')->get('chmod.file')); } } diff --git a/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.full.yml b/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.full.yml index cb44396..412942c 100644 --- a/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.full.yml +++ b/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.full.yml @@ -1,5 +1,5 @@ id: entity_test.full label: Full -status: '0' -cache: '1' +status: false +cache: true targetEntityType: entity_test diff --git a/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.test.yml b/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.test.yml index aa9b27e..baeed36 100644 --- a/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.test.yml +++ b/core/modules/system/tests/modules/entity_test/config/entity.view_mode.entity_test.test.yml @@ -1,5 +1,5 @@ id: entity_test.test label: Test -status: '0' -cache: '0' +status: false +cache: false targetEntityType: entity_test diff --git a/core/modules/system/tests/modules/update_script_test/config/update_script_test.settings.yml b/core/modules/system/tests/modules/update_script_test/config/update_script_test.settings.yml index e0be69e..0c4e667 100644 --- a/core/modules/system/tests/modules/update_script_test/config/update_script_test.settings.yml +++ b/core/modules/system/tests/modules/update_script_test/config/update_script_test.settings.yml @@ -1 +1 @@ -requirement_type: '0' +requirement_type: 0