From d5c179994cb8419ab9686e61410eba2f696f104f Mon Sep 17 00:00:00 2001 From: Carsten Rose <carsten.rose@math.uzh.ch> Date: Mon, 12 Feb 2018 00:11:00 +0100 Subject: [PATCH] Fixed problem with interpreting '0' as '' - link text was misinterpreted. --- extension/config.qfq.example.ini | 2 +- extension/qfq/qfq/report/Link.php | 21 +-------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/extension/config.qfq.example.ini b/extension/config.qfq.example.ini index 4f45ce9d5..0060bb6f2 100644 --- a/extension/config.qfq.example.ini +++ b/extension/config.qfq.example.ini @@ -132,4 +132,4 @@ WKHTMLTOPDF = /opt/wkhtmltox/bin/wkhtmltopdf ; thumbnailDirSecure = fileadmin/protected/qfqThumbnail ; thumbnailDirPublic = typo3temp/qfqThumbnail ; cmdInkscape = inkscape -; cmdConvert = convert \ No newline at end of file +; cmdConvert = convert diff --git a/extension/qfq/qfq/report/Link.php b/extension/qfq/qfq/report/Link.php index d7df298d1..83cfd4732 100644 --- a/extension/qfq/qfq/report/Link.php +++ b/extension/qfq/qfq/report/Link.php @@ -947,31 +947,12 @@ class Link { $order = ($vars[NAME_RIGHT] === "l") ? [FINAL_SYMBOL, FINAL_THUMBNAIL, NAME_TEXT] : [NAME_TEXT, FINAL_THUMBNAIL, FINAL_SYMBOL]; foreach ($order as $key) { - if (!empty($vars[$key])) { + if (isset($vars[$key]) && $vars[$key] != '') { // empty() is wrong here, cause '0' would be recognized as empty. $arr[] = $vars[$key]; } } $content = implode(' ', $arr); - // Compose Image & Text -// if ($htmlImage === '') { -// $content = $vars[NAME_TEXT]; -// } elseif ($vars[NAME_TEXT] === '') { -// $content = $htmlImage; -// } else { -// if ($vars[NAME_RIGHT] === "l") { -// $content = implode(' ', [$htmlImage, $vars[NAME_TEXT]]); -// } else { -// $content = implode(' ', [$vars[NAME_TEXT], $htmlImage]); -// } -// } - -// if ($vars[NAME_RIGHT] === "l") { -// $content = implode(' ', [$htmlImage, $vars[NAME_TEXT]]); -// } else { -// $content = implode(' ', [$vars[NAME_TEXT], $htmlImage]); -// } - if ($vars[NAME_EXTRA_CONTENT_WRAP] != '') { $content = Support::wrapTag($vars[NAME_EXTRA_CONTENT_WRAP], $content); } -- GitLab