1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-09 09:36:29 +02:00

Avoid 'undefined index' notice when downloading a file

This commit is contained in:
Marco Dickert
2018-03-15 15:28:53 +01:00
parent 6b7149cf14
commit 5c6905607e
3 changed files with 5 additions and 3 deletions

View File

@@ -70,6 +70,7 @@ class IFM {
$this->config['defaulttimezone'] = getenv('IFM_DEFAULTTIMEZONE') !== false ? getenv('IFM_DEFAULTTIMEZONE') : $this->config['defaulttimezone'] ;
$this->config['forbiddenChars'] = getenv('IFM_FORBIDDENCHARS') !== false ? str_split( getenv('IFM_FORBIDDENCHARS') ) : $this->config['forbiddenChars'] ;
$this->config['language'] = getenv('IFM_LANGUAGE') !== false ? getenv('IFM_LANGUAGE') : $this->config['language'] ;
$this->config['selfoverwrite'] = getenv('IFM_SELFOVERWRITE') !== false ? getenv('IFM_SELFOVERWRITE') : $this->config['selfoverwrite'] ;
$this->config['ajaxrequest'] = getenv('IFM_API_AJAXREQUEST') !== false ? intval( getenv('IFM_API_AJAXREQUEST') ) : $this->config['ajaxrequest'] ;
$this->config['chmod'] = getenv('IFM_API_CHMOD') !== false ? intval( getenv('IFM_API_CHMOD') ) : $this->config['chmod'] ;
$this->config['copymove'] = getenv('IFM_API_COPYMOVE') !== false ? intval( getenv('IFM_API_COPYMOVE') ) : $this->config['copymove'] ;
@@ -4277,7 +4278,7 @@ function IFM( params ) {
}
private function fileDownload( array $options ) {
if( $options['forceDL'] )
if( isset( $options['forceDL'] ) && $options['forceDL'] )
$content_type = "application/octet-stream";
else
$content_type = mime_content_type( $options['file'] );

View File

@@ -70,6 +70,7 @@ class IFM {
$this->config['defaulttimezone'] = getenv('IFM_DEFAULTTIMEZONE') !== false ? getenv('IFM_DEFAULTTIMEZONE') : $this->config['defaulttimezone'] ;
$this->config['forbiddenChars'] = getenv('IFM_FORBIDDENCHARS') !== false ? str_split( getenv('IFM_FORBIDDENCHARS') ) : $this->config['forbiddenChars'] ;
$this->config['language'] = getenv('IFM_LANGUAGE') !== false ? getenv('IFM_LANGUAGE') : $this->config['language'] ;
$this->config['selfoverwrite'] = getenv('IFM_SELFOVERWRITE') !== false ? getenv('IFM_SELFOVERWRITE') : $this->config['selfoverwrite'] ;
$this->config['ajaxrequest'] = getenv('IFM_API_AJAXREQUEST') !== false ? intval( getenv('IFM_API_AJAXREQUEST') ) : $this->config['ajaxrequest'] ;
$this->config['chmod'] = getenv('IFM_API_CHMOD') !== false ? intval( getenv('IFM_API_CHMOD') ) : $this->config['chmod'] ;
$this->config['copymove'] = getenv('IFM_API_COPYMOVE') !== false ? intval( getenv('IFM_API_COPYMOVE') ) : $this->config['copymove'] ;
@@ -4277,7 +4278,7 @@ function IFM( params ) {
}
private function fileDownload( array $options ) {
if( $options['forceDL'] )
if( isset( $options['forceDL'] ) && $options['forceDL'] )
$content_type = "application/octet-stream";
else
$content_type = mime_content_type( $options['file'] );

View File

@@ -1260,7 +1260,7 @@ f00bar;
}
private function fileDownload( array $options ) {
if( $options['forceDL'] )
if( isset( $options['forceDL'] ) && $options['forceDL'] )
$content_type = "application/octet-stream";
else
$content_type = mime_content_type( $options['file'] );