summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--modules/system/system.install9
2 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 30948b625..26e05739c 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.36, xxxx-xx-xx (development version)
-----------------------
+- Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused private
+ files to be inaccessible.
- Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused user
pictures to be lost.
- Fixed missing language code in hook_field_attach_view_alter() when it is
diff --git a/modules/system/system.install b/modules/system/system.install
index 43c7383a3..64c989a61 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2854,7 +2854,14 @@ function system_update_7061(&$sandbox) {
// We will convert filepaths to URI using the default scheme
// and stripping off the existing file directory path.
$file['uri'] = $scheme . preg_replace('!^' . preg_quote($basename) . '!', '', $file['filepath']);
- $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
+ // Normalize the URI but don't call file_stream_wrapper_uri_normalize()
+ // directly, since that is a higher-level API function which invokes
+ // hooks while validating the scheme, and those will not work during
+ // the upgrade. Instead, use a simpler version that just assumes the
+ // scheme from above is already valid.
+ if (($file_uri_scheme = file_uri_scheme($file['uri'])) && ($file_uri_target = file_uri_target($file['uri']))) {
+ $file['uri'] = $file_uri_scheme . '://' . $file_uri_target;
+ }
unset($file['filepath']);
// Insert into the file_managed table.
// Each fid should only be stored once in file_managed.