diff --git a/core/includes/file.inc b/core/includes/file.inc index bcd3033..be1126c 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -1525,13 +1525,13 @@ function file_get_mimetype($uri, $mapping = NULL) { /** * Sets the permissions on a file or directory. * - * This function will use the 'file_chmod_directory' and 'file_chmod_file' - * variables for the default modes for directories and uploaded/generated - * files. By default these will give everyone read access so that users - * accessing the files with a user account without the webserver group (e.g. - * via FTP) can read these files, and give group write permissions so webserver - * group members (e.g. a vhost account) can alter files uploaded and owned by - * the webserver. + * This function will use the system.file:chmod.directory and + * system.file:chmod.file configuration for the default modes for directories + * and uploaded/generated files. By default these will give everyone read access + * so that users accessing the files with a user account without the webserver + * group (e.g. via FTP) can read these files, and give group write permissions + * so webserver group members (e.g. a vhost account) can alter files uploaded + * and owned by the webserver. * * PHP's chmod does not support stream wrappers so we use our wrapper * implementation which interfaces with chmod() by default. Contrib wrappers @@ -1550,11 +1550,20 @@ 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 = variable_get('file_chmod_directory', 0775); + $mode = octdec(config('system.file')->get('chmod.directory')); + if (!$mode) { + $mode = 0775; + } } else { - $mode = variable_get('file_chmod_file', 0664); + $mode = octdec(config('system.file')->get('chmod.file')); + if (!$mode) { + $mode = 0664; + } } } @@ -1731,7 +1740,11 @@ function drupal_basename($uri, $suffix = NULL) { */ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) { if (!isset($mode)) { - $mode = variable_get('file_chmod_directory', 0775); + // Configuration system stores default mode as strings. + $mode = octdec(config('system.file')->get('chmod.directory')); + if (!$mode) { + $mode = 0775; + } } if (!isset($context)) { @@ -1847,7 +1860,7 @@ function file_directory_temp() { if (empty($temporary_directory)) { // If no directory has been found default to 'files/tmp'. - $temporary_directory = variable_get('file_public_path', conf_path() . '/files') . '/tmp'; + $temporary_directory = (config('system.file')->get('path.public') ?: conf_path() . '/files') . '/tmp'; // Windows accepts paths with either slash (/) or backslash (\), but will // not accept a path which contains both a slash and a backslash. Since diff --git a/core/lib/Drupal/Core/StreamWrapper/PublicStream.php b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php index 207b77a..8ca5f5b 100644 --- a/core/lib/Drupal/Core/StreamWrapper/PublicStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php @@ -19,7 +19,7 @@ class PublicStream extends LocalStream { * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath() */ public function getDirectoryPath() { - return variable_get('file_public_path', conf_path() . '/files'); + return config('system.file')->get('path.public') ?: conf_path() . '/files'; } /** diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php index a7e38ac..a9d569f 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php @@ -76,7 +76,7 @@ function setUp() { function testImageSource() { global $base_url; - $public_files_path = variable_get('file_public_path', conf_path() . '/files'); + $public_files_path = config('system.file')->get('path.public') ?: conf_path() . '/files'; $http_base_url = preg_replace('/^https?/', 'http', $base_url); $https_base_url = preg_replace('/^https?/', 'https', $base_url); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareTest.php index 017e2c5..bd166ec 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleCompareTest.php @@ -189,7 +189,7 @@ function testCompareCheckLocal() { $timestamp_new = REQUEST_TIME; // Set up the environment. - $public_path = variable_get('file_public_path', conf_path() . '/files'); + $public_path = config('system.file')->get('path.public') ?: conf_path() . '/files'; $this->setTranslationsDirectory($public_path . '/local'); $config->set('translation.default_filename', '%project-%version.%language.txt')->save(); diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.module b/core/modules/locale/tests/modules/locale_test/locale_test.module index 03e455d..05a74a5 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.module +++ b/core/modules/locale/tests/modules/locale_test/locale_test.module @@ -42,11 +42,11 @@ function locale_test_locale_translation_projects_alter(&$projects) { // Instead of the default ftp.drupal.org we use the file system of the test // instance to simulate a remote file location. $url = url(NULL, array('absolute' => TRUE)); - $remote_url = $url . variable_get('file_public_path', conf_path() . '/files') . '/remote/'; + $remote_url = $url . (config('system.file')->get('path.public') ?: conf_path() . '/files') . '/remote/'; // Completely replace the project data with a set of test projects. $base_url = url(); - $files_url = variable_get('file_public_path', conf_path() . '/files'); + $files_url = config('system.file')->get('path.public') ?: conf_path() . '/files'; $projects = array ( 'drupal' => array ( 'name' => 'drupal', diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 93cdbf2..d9ed678 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -647,7 +647,7 @@ public function run(array $methods = array()) { if ($simpletest_config->get('verbose')) { // Initialize verbose debugging. $this->verbose = TRUE; - $this->verboseDirectory = variable_get('file_public_path', conf_path() . '/files') . '/simpletest/verbose'; + $this->verboseDirectory = (config('system.file')->get('path.public') ?: conf_path() . '/files') . '/simpletest/verbose'; $this->verboseDirectoryUrl = file_create_url($this->verboseDirectory); if (file_prepare_directory($this->verboseDirectory, FILE_CREATE_DIRECTORY) && !file_exists($this->verboseDirectory . '/.htaccess')) { file_put_contents($this->verboseDirectory . '/.htaccess', "\nExpiresActive Off\n\n"); @@ -826,7 +826,7 @@ protected function prepareEnvironment() { $this->originalTheme = isset($GLOBALS['theme']) ? $GLOBALS['theme'] : NULL; // Save further contextual information. - $this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files'); + $this->originalFileDirectory = config('system.file')->get('path.public') ?: conf_path() . '/files'; $this->originalProfile = drupal_get_profile(); $this->originalUser = isset($user) ? clone $user : NULL; diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 001e521..9e2bd0e 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -368,7 +368,7 @@ protected function drupalGetTestFiles($type, $size = NULL) { $original = drupal_get_path('module', 'simpletest') . '/files'; $files = file_scan_directory($original, '/(html|image|javascript|php|sql)-.*/'); foreach ($files as $file) { - file_unmanaged_copy($file->uri, variable_get('file_public_path', conf_path() . '/files')); + file_unmanaged_copy($file->uri, config('system.file')->get('path.public') ?: conf_path() . '/files'); } $this->generatedTestFiles = TRUE; @@ -714,8 +714,8 @@ protected function setUp() { $batch = &batch_get(); $batch = array(); $variables = array( - 'file_public_path' => $this->public_files_directory, 'file_private_path' => $this->private_files_directory, + 'file_public_path' => $this->public_files_directory, 'file_temporary_path' => $this->temp_files_directory, 'locale_translate_file_directory' => $this->translation_files_directory, ); @@ -739,6 +739,15 @@ protected function setUp() { unset($conf['lock_backend']); // Set path variables. + $paths = config('system.file'); + + $file_variables = array( + 'path.public' => $this->public_files_directory, + ); + foreach ($file_variables as $key => $val) { + $paths->set($key, $val); + } + $paths->save(); // Set 'parent_profile' of simpletest to add the parent profile's // search path to the child site's search paths. diff --git a/core/modules/system/config/system.file.yml b/core/modules/system/config/system.file.yml new file mode 100644 index 0000000..e5bac32 --- /dev/null +++ b/core/modules/system/config/system.file.yml @@ -0,0 +1,10 @@ +allow_insecure_uploads: '0' +# chmod variables should be a string in PHP Octal Notation. +chmod: + directory: '0775' + file: '0664' +default_scheme: public +path: + private: '' + public: '' + temporary: '' 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 e6f3396..399e4dc 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php @@ -51,7 +51,7 @@ function testFileCheckDirectoryHandling() { } // Test that the directory has the correct permissions. - $this->assertDirectoryPermissions($directory, variable_get('file_chmod_directory', 0775)); + $this->assertDirectoryPermissions($directory, octdec(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/StreamWrapperTest.php b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php index f94d7b1..464ca13 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php @@ -80,7 +80,7 @@ function testUriFunctions() { // Test file_build_uri() and // Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath(). $this->assertEqual(file_build_uri('foo/bar.txt'), 'public://foo/bar.txt', 'Expected scheme was added.'); - $this->assertEqual(file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath(), variable_get('file_public_path'), 'Expected default directory path was returned.'); + $this->assertEqual(file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath(), config('system.file')->get('path.public'), 'Expected default directory path was returned.'); $this->assertEqual(file_stream_wrapper_get_instance_by_scheme('temporary')->getDirectoryPath(), variable_get('file_temporary_path'), 'Expected temporary directory path was returned.'); variable_set('file_default_scheme', 'private'); 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 7056946..7f5248c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php @@ -23,6 +23,7 @@ public static function getInfo() { * Copy a normal file. */ function testNormal() { + $config = config('system.file'); // Create a file for testing $uri = $this->createUri(); @@ -33,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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); // Copying with rename. $desired_filepath = 'public://' . $this->randomName(); @@ -43,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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($newer_filepath, octdec($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) @@ -64,6 +65,7 @@ function testNonExistent() { * Copy a file onto itself. */ function testOverwriteSelf() { + $config = config('system.file'); // Create a file for testing $uri = $this->createUri(); @@ -73,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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); // Copy the file onto itself without renaming fails. $new_filepath = file_unmanaged_copy($uri, $uri, FILE_EXISTS_ERROR); @@ -91,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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($new_filepath, octdec($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 6e0ec14..23ac632 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php @@ -23,6 +23,7 @@ public static function getInfo() { * Move a normal file. */ function testNormal() { + $config = config('system.file'); // Create a file for testing $uri = $this->createUri(); @@ -33,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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($new_filepath, octdec($config->get('chmod.file'))); // Moving with rename. $desired_filepath = 'public://' . $this->randomName(); @@ -44,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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($newer_filepath, octdec($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 cde75c7..1077c4c 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, variable_get('file_chmod_file', 0664)); + $this->assertFilePermissions($filepath, octdec(config('system.file')->get('chmod.file'))); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php b/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php index e106e04..ada6e03 100644 --- a/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/FileTransfer/FileTransferTest.php @@ -91,7 +91,7 @@ function testJail() { $gotit = TRUE; try { - $this->testConnection->copyDirectory($source, DRUPAL_ROOT . '/'. variable_get('file_public_path', conf_path() . '/files')); + $this->testConnection->copyDirectory($source, DRUPAL_ROOT . '/'. config('system.file')->get('path.public') ?: conf_path() . '/files'); } catch (FileTransferException $e) { $gotit = FALSE; diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php index 111e6b7..b4b1dd8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -45,7 +45,7 @@ function setUp() { function testThemeSettings() { // Specify a filesystem path to be used for the logo. $file = current($this->drupalGetTestFiles('image')); - $file_relative = strtr($file->uri, array('public:/' => variable_get('file_public_path', conf_path() . '/files'))); + $file_relative = strtr($file->uri, array('public:/' => config('system.file')->get('path.public') ?: conf_path() . '/files')); $default_theme_path = 'core/themes/stark'; $supported_paths = array( @@ -97,7 +97,7 @@ function testThemeSettings() { if (file_uri_scheme($input) == 'public') { $implicit_public_file = file_uri_target($input); $explicit_file = $input; - $local_file = strtr($input, array('public:/' => variable_get('file_public_path', conf_path() . '/files'))); + $local_file = strtr($input, array('public:/' => config('system.file')->get('path.public') ?: conf_path() . '/files')); } // Adjust for fully qualified stream wrapper URI elsewhere. elseif (file_uri_scheme($input) !== FALSE) { @@ -107,7 +107,7 @@ function testThemeSettings() { elseif ($input == file_uri_target($file->uri)) { $implicit_public_file = $input; $explicit_file = 'public://' . $input; - $local_file = variable_get('file_public_path', conf_path() . '/files') . '/' . $input; + $local_file = (config('system.file')->get('path.public') ?: conf_path() . '/files') . '/' . $input; } $this->assertEqual((string) $elements[0], $implicit_public_file); $this->assertEqual((string) $elements[1], $explicit_file); @@ -119,6 +119,7 @@ function testThemeSettings() { $this->assertEqual((string) $elements[0]['src'], $expected['src']); } + $public = config('system.file')->get('path.public'); $unsupported_paths = array( // Stream wrapper URI to non-existing file. 'public://whatever.png', @@ -132,9 +133,9 @@ function testThemeSettings() { // Relative path within the public filesystem to non-existing file. 'whatever.png', // Relative path to non-existing file in public filesystem. - variable_get('file_public_path', conf_path() . '/files') . '/whatever.png', + ($public ? $public : conf_path() . '/files') . '/whatever.png', // Semi-absolute path to non-existing file in public filesystem. - '/' . variable_get('file_public_path', conf_path() . '/files') . '/whatever.png', + '/' . ($public ? $public : conf_path() . '/files') . '/whatever.png', // Relative path to arbitrary non-existing file. 'core/misc/whatever.png', // Semi-absolute path to arbitrary non-existing file. 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 a62eb90..23c9e27 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php @@ -115,7 +115,7 @@ protected function setUp() { } // Set path variables. - $this->variable_set('file_public_path', $this->public_files_directory); + $this->config('system.file')->set('path.public', $this->public_files_directory)->save(); $this->variable_set('file_private_path', $this->private_files_directory); $this->variable_set('file_temporary_path', $this->temp_files_directory); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index b8cae7a..2d10934 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -524,7 +524,7 @@ function system_theme_settings($form, &$form_state, $key = '') { // Prepare local file path for description. if ($original_path && isset($friendly_path)) { - $local_file = strtr($original_path, array('public:/' => variable_get('file_public_path', conf_path() . '/files'))); + $local_file = strtr($original_path, array('public:/' => config('system.file')->get('path.public') ?: conf_path() . '/files')); } elseif ($key) { $local_file = drupal_get_path('theme', $key) . '/' . $default; @@ -732,7 +732,6 @@ function system_theme_settings_submit($form, &$form_state) { $values['favicon_mimetype'] = file_get_mimetype($values['favicon_path']); } } - variable_set($key, $values); drupal_set_message(t('The configuration options have been saved.')); @@ -1725,10 +1724,11 @@ function system_clear_page_cache_submit($form, &$form_state) { * @see system_settings_form() */ function system_file_system_settings() { + $config = config('system.file'); $form['file_public_path'] = array( '#type' => 'textfield', '#title' => t('Public file system path'), - '#default_value' => variable_get('file_public_path', conf_path() . '/files'), + '#default_value' => $config->get('path.public') ?: conf_path() . '/files', '#maxlength' => 255, '#description' => t('A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'), '#after_build' => array('system_check_directory'), @@ -1767,9 +1767,23 @@ function system_file_system_settings() { ); } - return system_settings_form($form); + $form['#submit'][] = 'system_file_system_settings_submit'; + + return system_config_form($form, $form_state); +} + +/** + * Form submission handler for system_file_system_settings(). + * + * @ingroup forms + */ +function system_file_system_settings_submit($form, &$form_state) { + $config = config('system.file'); + $config->set('path.public', $form_state['values']['file_public_path']); + $config->save(); } + /** * Form builder; Configure site image toolkit usage. * diff --git a/core/modules/system/system.install b/core/modules/system/system.install index be3a6d8..f074f6f 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -310,8 +310,9 @@ function system_requirements($phase) { // cache must also be reset in this case. $require_settings = ($phase != 'install'); $reset_cache = !$require_settings; + $public = config('system.file')->get('path.public'); $directories = array( - variable_get('file_public_path', conf_path($require_settings, $reset_cache) . '/files'), + $public ? $public : conf_path($require_settings, $reset_cache) . '/files', // By default no private files directory is configured. For private files // to be secure the admin needs to provide a path outside the webroot. variable_get('file_private_path', FALSE), @@ -2317,6 +2318,13 @@ function system_update_8040() { update_variables_to_config('system.performance', $variable_map); } +function system_update_8041() { + $variable_map = array( + 'file_public_path' => 'path.public', + ); + update_variables_to_config('system.file', $variable_map); +} + /** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000.