diff options
author | David Rothstein <drothstein@gmail.com> | 2015-03-29 22:56:35 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-03-29 22:56:35 -0400 |
commit | 9dafd622f00485a1889bfd22bcf1291e2aed647b (patch) | |
tree | abad20e0aa4e8f8b65ad016d22b49ed5053772c1 /modules/system | |
parent | 2ace1905b59b779a87e3ad1a125d5bb52193aa61 (diff) | |
download | brdo-9dafd622f00485a1889bfd22bcf1291e2aed647b.tar.gz brdo-9dafd622f00485a1889bfd22bcf1291e2aed647b.tar.bz2 |
Issue #1404050 by JamesOakley, David_Rothstein: system_update_7061 breaks private files by leaving one too many forward slashes in protocol of migrated URIs
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.install | 9 |
1 files changed, 8 insertions, 1 deletions
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. |