updated core from 8.4 to 8.5 : bug with login_destination

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-13 14:01:21 +01:00
parent 0d78da249b
commit e668535a4e
3486 changed files with 89604 additions and 33283 deletions
+11 -8
View File
@@ -462,8 +462,9 @@ function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXIST
}
// Attempt to resolve the URIs. This is necessary in certain configurations
// (see above).
$real_source = drupal_realpath($source) ?: $source;
$real_destination = drupal_realpath($destination) ?: $destination;
$file_system = \Drupal::service('file_system');
$real_source = $file_system->realpath($source) ?: $source;
$real_destination = $file_system->realpath($destination) ?: $destination;
// Perform the copy operation.
if (!@copy($real_source, $real_destination)) {
\Drupal::logger('file')->error('The specified file %file could not be copied to %destination.', ['%file' => $source, '%destination' => $destination]);
@@ -507,12 +508,13 @@ function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXIST
function file_unmanaged_prepare($source, &$destination = NULL, $replace = FILE_EXISTS_RENAME) {
$original_source = $source;
$logger = \Drupal::logger('file');
$file_system = \Drupal::service('file_system');
// Assert that the source file actually exists.
if (!file_exists($source)) {
// @todo Replace drupal_set_message() calls with exceptions instead.
drupal_set_message(t('The specified file %file could not be moved/copied because no file by that name exists. Please check that you supplied the correct filename.', ['%file' => $original_source]), 'error');
if (($realpath = drupal_realpath($original_source)) !== FALSE) {
if (($realpath = $file_system->realpath($original_source)) !== FALSE) {
$logger->notice('File %file (%realpath) could not be moved/copied because it does not exist.', ['%file' => $original_source, '%realpath' => $realpath]);
}
else {
@@ -551,8 +553,8 @@ function file_unmanaged_prepare($source, &$destination = NULL, $replace = FILE_E
}
// Assert that the source and destination filenames are not the same.
$real_source = drupal_realpath($source);
$real_destination = drupal_realpath($destination);
$real_source = $file_system->realpath($source);
$real_destination = $file_system->realpath($destination);
if ($source == $destination || ($real_source !== FALSE) && ($real_source == $real_destination)) {
drupal_set_message(t('The specified file %file was not moved/copied because it would overwrite itself.', ['%file' => $source]), 'error');
$logger->notice('File %file could not be moved/copied because it would overwrite itself.', ['%file' => $source]);
@@ -652,8 +654,9 @@ function file_unmanaged_move($source, $destination = NULL, $replace = FILE_EXIST
}
// Attempt to resolve the URIs. This is necessary in certain configurations
// (see above) and can also permit fast moves across local schemes.
$real_source = drupal_realpath($source) ?: $source;
$real_destination = drupal_realpath($destination) ?: $destination;
$file_system = \Drupal::service('file_system');
$real_source = $file_system->realpath($source) ?: $source;
$real_destination = $file_system->realpath($destination) ?: $destination;
// Perform the move operation.
if (!@rename($real_source, $real_destination)) {
// Fall back to slow copy and unlink procedure. This is necessary for
@@ -892,7 +895,7 @@ function file_unmanaged_delete($path) {
*
* @param $path
* A string containing either an URI or a file or directory path.
* @param $callback
* @param callable $callback
* (optional) Callback function to run on each file prior to deleting it and
* on each directory prior to traversing it. For example, can be used to
* modify permissions.