Skip to content
Permalink
Browse files

Fix PHP flaw around intval with custom base.

  • Loading branch information...
dereuromark committed Sep 10, 2014
1 parent 282bc0c commit 3e25282d4c3f9940a7c9939bd189b89340c9d181
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Utility/Folder.php
@@ -382,7 +382,7 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr
if ($recursive === false && is_dir($path)) {
//@codingStandardsIgnoreStart
if (@chmod($path, intval($mode, 8))) {
if (@chmod($path, intval((string)$mode, 8))) {
//@codingStandardsIgnoreEnd
$this->_messages[] = __d('cake_dev', '%s changed to %s', $path, $mode);
return true;
@@ -405,7 +405,7 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr
}
//@codingStandardsIgnoreStart
if (@chmod($fullpath, intval($mode, 8))) {
if (@chmod($fullpath, intval((string)$mode, 8))) {
//@codingStandardsIgnoreEnd
$this->_messages[] = __d('cake_dev', '%s changed to %s', $fullpath, $mode);
} else {
@@ -681,7 +681,7 @@ public function copy($options) {
$from = Folder::addPathElement($fromDir, $item);
if (is_file($from) && (!is_file($to) || $options['scheme'] != Folder::SKIP)) {
if (copy($from, $to)) {
chmod($to, intval($mode, 8));
chmod($to, intval((string)$mode, 8));
touch($to, filemtime($from));
$this->_messages[] = __d('cake_dev', '%s copied to %s', $from, $to);
} else {

0 comments on commit 3e25282

Please sign in to comment.
You can’t perform that action at this time.