Fix PHP flaw around intval with custom base.

This commit is contained in:
euromark 2014-09-10 17:40:01 +02:00
parent 282bc0ca92
commit 3e25282d4c

View file

@ -382,7 +382,7 @@ class Folder {
if ($recursive === false && is_dir($path)) { if ($recursive === false && is_dir($path)) {
//@codingStandardsIgnoreStart //@codingStandardsIgnoreStart
if (@chmod($path, intval($mode, 8))) { if (@chmod($path, intval((string)$mode, 8))) {
//@codingStandardsIgnoreEnd //@codingStandardsIgnoreEnd
$this->_messages[] = __d('cake_dev', '%s changed to %s', $path, $mode); $this->_messages[] = __d('cake_dev', '%s changed to %s', $path, $mode);
return true; return true;
@ -405,7 +405,7 @@ class Folder {
} }
//@codingStandardsIgnoreStart //@codingStandardsIgnoreStart
if (@chmod($fullpath, intval($mode, 8))) { if (@chmod($fullpath, intval((string)$mode, 8))) {
//@codingStandardsIgnoreEnd //@codingStandardsIgnoreEnd
$this->_messages[] = __d('cake_dev', '%s changed to %s', $fullpath, $mode); $this->_messages[] = __d('cake_dev', '%s changed to %s', $fullpath, $mode);
} else { } else {
@ -681,7 +681,7 @@ class Folder {
$from = Folder::addPathElement($fromDir, $item); $from = Folder::addPathElement($fromDir, $item);
if (is_file($from) && (!is_file($to) || $options['scheme'] != Folder::SKIP)) { if (is_file($from) && (!is_file($to) || $options['scheme'] != Folder::SKIP)) {
if (copy($from, $to)) { if (copy($from, $to)) {
chmod($to, intval($mode, 8)); chmod($to, intval((string)$mode, 8));
touch($to, filemtime($from)); touch($to, filemtime($from));
$this->_messages[] = __d('cake_dev', '%s copied to %s', $from, $to); $this->_messages[] = __d('cake_dev', '%s copied to %s', $from, $to);
} else { } else {