Commit 12452a4a authored by Carsten  Rose's avatar Carsten Rose
Browse files

Download.php: Fix broken variable $this->$downloadDebugLog.

parent 7d1bebae
Pipeline #5360 passed with stages
in 4 minutes and 25 seconds
......@@ -641,7 +641,7 @@ Summary:
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _exec | :ref:`column_exec` - Run batch files or executables on the webserver. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _script | :ref:`column_script` - Run php function defined in an external script |
| _script | :ref:`column_script` - Run php function defined in an external script. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| _vertical | :ref:`column_vertical` - Render Text vertically. This is useful for tables with limited column width. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
......
......@@ -203,8 +203,8 @@ class Download {
// img2pdf --pagesize A4 -o out.pdf *.jpg
$cmd = $this->img2Pdf . ' --pagesize A4 -o ' . $filePdf . ' ' . escapeshellarg($fileImage) . ' 2>&1';
if ($this->downloadDebugLog != '') {
Logger::logMessage("Download: $cmd", $this->downloadDebugLog);
if ($this->$downloadDebugLogAbsolute != '') {
Logger::logMessage("Download: $cmd", $this->$downloadDebugLogAbsolute);
}
exec($cmd, $rcOutput, $rc);
......@@ -498,10 +498,13 @@ class Download {
$len = strlen(TMP_FILE_PREFIX);
$ii = 1;
foreach ($files as $item) {
// a) $item: fileadmin/dog.jpg, b) $item: fileamdmin/doc.jpg:directory1/directory2/dog.jpg
$arr = explode(PARAM_TOKEN_DELIMITER, $item);
$filename = $arr[0] ?? '';
$localName = ($arr[1] == '') ? substr($filename, strrpos($filename, '/') + 1) : $arr[1];
// Check if a new target path/filename is specified. if not, extract remove preceeding path.
$localName = (($arr[1] ?? '') == '') ? substr($filename, strrpos($filename, '/') + 1) : $arr[1];
// If the final filename is a QFQ tempfile and still contains TMP_FILE_PREFIX: remove the prefix and replace it by 'file-?'
if (substr($localName, 0, $len) == TMP_FILE_PREFIX) {
$localName = 'file-' . $ii;
$ii++;
......
......@@ -990,6 +990,7 @@ class Save {
$reader->setLoadSheetsOnly($importNamedSheetsOnly);
}
// Debug option importListSheetNames=1 will list all recognized sheetnames and stops import.
if (($formElement[FE_IMPORT_LIST_SHEET_NAMES] ?? '0') != '0') {
$sheetNames = $reader->listWorksheetNames($fileName);
throw new \UserFormException("Worksheets: " . implode(', ', $sheetNames),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment