Skip to content

Commit

Permalink
$pathinfo => $pathInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Oct 28, 2011
1 parent 655d2b3 commit 04745f8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions models/behaviors/upload.php
Expand Up @@ -596,9 +596,9 @@ function isValidExtension(&$model, $check, $extensions) {
}

if (empty($extensions)) $extensions = $this->settings[$model->alias][$field]['extensions'];
$pathinfo = $this->_pathinfo($check[$field]['name']);
$pathInfo = $this->_pathinfo($check[$field]['name']);

return in_array($pathinfo['extension'], $extensions);
return in_array($pathInfo['extension'], $extensions);
}

/**
Expand Down Expand Up @@ -792,7 +792,7 @@ function _resizePhp(&$model, $field, $path, $style, $geometry, $thumbnailPath) {
$src = null;
$createHandler = null;
$outputHandler = null;
switch (strtolower($pathinfo['extension'])) {
switch (strtolower($pathInfo['extension'])) {
case 'gif':
$createHandler = 'imagecreatefromgif';
$outputHandler = 'imagegif';
Expand Down Expand Up @@ -1009,17 +1009,17 @@ function _prepareFilesForDeletion(&$model, $field, $data, $options) {
}

function _pathinfo($filename) {
$pathinfo = pathinfo($filename);
$pathInfo = pathinfo($filename);

if (!isset($pathinfo['extension']) || !strlen($pathinfo['extension'])) {
$pathinfo['extension'] = '';
if (!isset($pathInfo['extension']) || !strlen($pathInfo['extension'])) {
$pathInfo['extension'] = '';
}

// PHP < 5.2.0 doesn't include 'filename' key in pathinfo. Let's try to fix this.
if (empty($pathinfo['filename'])) {
$pathinfo['filename'] = basename($pathinfo['basename'], '.' . $pathinfo['extension']);
if (empty($pathInfo['filename'])) {
$pathInfo['filename'] = basename($pathInfo['basename'], '.' . $pathInfo['extension']);
}
return $pathinfo;
return $pathInfo;
}

}

0 comments on commit 04745f8

Please sign in to comment.