mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fixes #16183: Fixed when yii\helpers\BaseFileHelper sometimes returned wrong value
This commit is contained in:
committed by
Alexander Makarov
parent
f8f53a2d07
commit
ba0a3c00ca
@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
||||
2.0.16 under development
|
||||
------------------------
|
||||
|
||||
- Bug #16183: Fixed when `yii\helpers\BaseFileHelper` sometimes returned wrong value (samdark, SilverFire, OndrejVasicek)
|
||||
- Bug #13932: Fix number validator attributes comparison (uaoleg, s1lver)
|
||||
- Bug #14039, #16636: Fixed validation for disabled inputs (s1lver, omzy83)
|
||||
- Bug #16425: Check for additional values for disabled confirm dialog (Alex-Code, s1lver)
|
||||
|
||||
@ -415,9 +415,13 @@ class BaseFileHelper
|
||||
return unlink($path);
|
||||
} catch (ErrorException $e) {
|
||||
// last resort measure for Windows
|
||||
$lines = [];
|
||||
exec('DEL /F/Q ' . escapeshellarg($path), $lines, $deleteError);
|
||||
return $deleteError !== 0;
|
||||
if (function_exists('exec') && file_exists($path)) {
|
||||
exec('DEL /F/Q ' . escapeshellarg($path));
|
||||
|
||||
return !file_exists($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user