Changeset 485 for trunk/lib/Upload.inc.php
- Timestamp:
- Aug 14, 2014 8:29:47 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Upload.inc.php
r484 r485 82 82 // Enforce valid upload_path parameter. 83 83 if (isset($params['upload_path'])) { 84 $ params['upload_path']= realpath($params['upload_path']);84 $upload_path = realpath($params['upload_path']); 85 85 // Source must be directory. 86 if (!is_dir($ params['upload_path'])) {87 $app->logMsg(sprintf('Attempting to auto-create upload directory: %s', $ params['upload_path']), LOG_NOTICE, __FILE__, __LINE__);86 if (!is_dir($upload_path)) { 87 $app->logMsg(sprintf('Attempting to auto-create upload directory: %s', $upload_path), LOG_NOTICE, __FILE__, __LINE__); 88 88 if (version_compare(PHP_VERSION, '5.0.0', '>=')) { 89 89 // Recursive. 90 mkdir($ params['upload_path'], isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'), true);90 mkdir($upload_path, isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'), true); 91 91 } else { 92 mkdir($ params['upload_path'], isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms'));92 mkdir($upload_path, isset($params['dest_dir_perms']) ? $params['dest_dir_perms'] : $this->getParam('dest_dir_perms')); 93 93 } 94 if (!is_dir($ params['upload_path'])) {94 if (!is_dir($upload_path)) { 95 95 $app->logMsg(sprintf('Upload directory invalid: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__); 96 96 trigger_error(sprintf('Upload directory invalid: %s', $params['upload_path']), E_USER_ERROR); … … 98 98 } 99 99 // Source must be writable. 100 if (!is_writable($ params['upload_path'])) {100 if (!is_writable($upload_path)) { 101 101 $app->logMsg(sprintf('Upload directory not writable: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__); 102 102 trigger_error(sprintf('Upload directory not writable: %s', $params['upload_path']), E_USER_ERROR); … … 197 197 if (is_array($custom_file_name) && sizeof($custom_file_name) == 1) { 198 198 // Is an array, but just one value. Pull it out. 199 $ custom_file_name = current($custom_file_name);199 $file_name = current($custom_file_name); 200 200 $this->_raiseMsg(sprintf(_("The file %s has been renamed to %s."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__); 201 201 $app->logMsg(sprintf('Using custom file name: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__); … … 520 520 $app =& App::getInstance(); 521 521 522 if ($this->getParam('display_messages') === true || (is_int($this->getParam('display_messages')) && $this->getParam('display_messages') & $type> 0)) {522 if ($this->getParam('display_messages') === true || (is_int($this->getParam('display_messages')) && ($this->getParam('display_messages') & $type) > 0)) { 523 523 $app->raiseMsg($message, $type, $file, $line); 524 524 }
Note: See TracChangeset
for help on using the changeset viewer.