mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixing issues where permissions would not be set to world writable on file caches.
This commit is contained in:
parent
9e3a41e013
commit
62e16c7058
1 changed files with 7 additions and 3 deletions
10
cake/libs/cache/file.php
vendored
10
cake/libs/cache/file.php
vendored
|
@ -76,9 +76,12 @@ class FileEngine extends CacheEngine {
|
|||
$settings
|
||||
));
|
||||
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
if (DS === '\\') {
|
||||
$this->settings['isWindows'] = true;
|
||||
}
|
||||
if (substr($this->settings['path'], -1) !== DS) {
|
||||
$this->settings['path'] .= DS;
|
||||
}
|
||||
return $this->_active();
|
||||
}
|
||||
|
||||
|
@ -266,15 +269,16 @@ class FileEngine extends CacheEngine {
|
|||
* @access protected
|
||||
*/
|
||||
protected function _setKey($key, $createKey = false) {
|
||||
$path = new SplFileInfo($this->settings['path'] . DS . $key);
|
||||
$path = new SplFileInfo($this->settings['path'] . $key);
|
||||
|
||||
if (!$createKey && !$path->isFile()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$old = umask(0);
|
||||
if (empty($this->_File) || $this->_File->getBaseName() !== $key) {
|
||||
$this->_File = $path->openFile('a+');
|
||||
}
|
||||
umask($old);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue