Skip to content

Commit 281961b

Browse files
committed
Merge branch 'crishoj-master' into development
2 parents 5a0d1a6 + 8bfa185 commit 281961b

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
],
1212
"require": {
1313
"php": ">=5.4.0",
14-
"symfony/finder": "~2.5|3.*|4.*",
15-
"symfony/http-foundation": "~2.5|3.*|4.*",
16-
"symfony/filesystem": "~2.5|3.*|4.*",
17-
"monolog/monolog": "~1.12",
14+
"symfony/finder": "~2.5|3.*|4.*|5.*",
15+
"symfony/http-foundation": "~2.5|3.*|4.*|5.*",
16+
"symfony/filesystem": "~2.5|3.*|4.*|5.*",
17+
"monolog/monolog": "~1.12|2.*",
1818
"gregwar/image": "2.*"
1919
},
2020
"require-dev": {

src/GuillermoMartinez/Filemanager/Filemanager.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,7 @@ public function _log($string,$type='info') {
240240
if($this->config['debug']){
241241
$string = $this->getLogTime().": ".$string;
242242
}
243-
if($type=='info')
244-
$this->log->addInfo($string);
245-
elseif($type=='warning')
246-
$this->log->addWarning($string);
247-
elseif($type=='error')
248-
$this->log->addError($string);
243+
$this->log->log($type, $string);
249244
}
250245

251246
/**
@@ -599,19 +594,19 @@ function ($a, $b) {return $b->getMTime() - $a->getMTime();}
599594
*/
600595
public function upload($file,$path){
601596
if( $this->validExt($file->getClientOriginalName())){
602-
if($file->getClientSize() > ($this->getMaxUploadFileSize() * 1024 * 1024) ){
597+
if($file->getSize() > ($this->getMaxUploadFileSize() * 1024 * 1024) ){
603598

604-
$result = array("query"=>"BE_UPLOAD_FILE_SIZE_NOT_SERVER","params"=>array($file->getClientSize()));
599+
$result = array("query"=>"BE_UPLOAD_FILE_SIZE_NOT_SERVER","params"=>array($file->getSize()));
605600
$this->setInfo(array("msg"=>$result));
606601

607-
if( $this->config['debug'] ) $this->_log(__METHOD__." - file size no permitido server: ".$file->getClientSize());
602+
if( $this->config['debug'] ) $this->_log(__METHOD__." - file size no permitido server: ".$file->getSize());
608603
return ;
609-
}elseif($file->getClientSize() > ($this->config['upload']['size_max'] * 1024 * 1024) ){
604+
}elseif($file->getSize() > ($this->config['upload']['size_max'] * 1024 * 1024) ){
610605

611-
$result = array("query"=>"BE_UPLOAD_FILE_SIZE_NOT_PERMITIDO","params"=>array($file->getClientSize()));
606+
$result = array("query"=>"BE_UPLOAD_FILE_SIZE_NOT_PERMITIDO","params"=>array($file->getSize()));
612607
$this->setInfo(array("msg"=>$result));
613608

614-
if( $this->config['debug'] ) $this->_log(__METHOD__." - file size no permitido: ".$file->getClientSize());
609+
if( $this->config['debug'] ) $this->_log(__METHOD__." - file size no permitido: ".$file->getSize());
615610
return ;
616611
}else{
617612
if($file->isValid()){
@@ -1033,4 +1028,4 @@ public function run(){
10331028
return $jsonResponse->sendContent();
10341029
}
10351030
}
1036-
?>
1031+
?>

0 commit comments

Comments
 (0)