Skip to content
Snippets Groups Projects
Commit 4ccf68da authored by catch's avatar catch
Browse files

Issue #3036494 by Berdir, alexpott, rgpublic, cilefen, kerasai, regilero: Race...

Issue #3036494 by Berdir, alexpott, rgpublic, cilefen, kerasai, regilero: Race condition in ImageStyle::createDerivative()

(cherry picked from commit f9fcde32)
parent cbe7ab10
Branches
Tags
6 merge requests!1286issue #3240655 by elfakhar,!1285Issue #3240655 by elfakhar Aligne the active border,!541Issue #3123070: Fix 'PSR2.Classes.PropertyDeclaration.Underscore' coding standard,!463Resolve #3205025 "Class align center for media",!386Allow multiple vocabularies in the taxonomy filter,!308Issue #3118206: Remote media does not validate provider
......@@ -520,12 +520,22 @@ public function prepareDirectory(&$directory, $options = self::MODIFY_PERMISSION
}
if (!is_dir($directory)) {
if (!($options & static::CREATE_DIRECTORY)) {
return FALSE;
}
// Let mkdir() recursively create directories and use the default
// directory permissions.
if ($options & static::CREATE_DIRECTORY) {
return @$this->mkdir($directory, NULL, TRUE);
$success = @$this->mkdir($directory, NULL, TRUE);
if ($success) {
return TRUE;
}
// If the operation failed, check again if the directory was created
// by another process/server, only report a failure if not. In this case
// we still need to ensure the directory is writable.
if (!is_dir($directory)) {
return FALSE;
}
return FALSE;
}
$writable = is_writable($directory);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment