Fix use of option RunWithEndFile
This commit is contained in:
parent
6a608349f5
commit
e88cf15c86
13
fileSend.php
13
fileSend.php
@ -121,8 +121,15 @@ if ( isset($opts->file) )
|
||||
}
|
||||
}
|
||||
|
||||
if ( $OptionsRunWithEndFile && !in_array( $extension, $runExtensions) ) {
|
||||
exit;
|
||||
//Get the realname of file IN or exit
|
||||
if ( $OptionsRunWithEndFile ) {
|
||||
if ( in_array( $extension, $runExtensions) ) {
|
||||
$extensionLength = strlen($extension)+1;
|
||||
$filenameIn = substr($filenameIn, 0, strlen($filenameIn) - $extensionLength);
|
||||
$extension = '';
|
||||
} else {
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$lines = file($fluxBasePath . '/' . $filenameIn);
|
||||
@ -136,7 +143,7 @@ if ( isset($opts->file) )
|
||||
$extensionLength = 0;
|
||||
if ( $extension != '' ) {
|
||||
$extensionLength = strlen($extension)+1;
|
||||
$filenameOut = substr($filenameIn, 0, strlen($filenameIn)-$extensionLength);
|
||||
$filenameOut = substr($filenameIn, 0, strlen($filenameIn) - $extensionLength);
|
||||
$filenameOut = $filenameOut . '_' . date('YmdHis') . '.' . $extension;
|
||||
} else {
|
||||
$filenameOut = $filenameIn . '_' . date('YmdHis');
|
||||
|
Loading…
Reference in New Issue
Block a user