From d5d9445cfd311f262608fe5dba464cb1469f6d7b Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 10 May 2020 23:41:04 +0200 Subject: [PATCH] Fix PHP errors in structured HTML output Correctly handle missing parameters. --- lib/template/search-html.php | 64 ++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/lib/template/search-html.php b/lib/template/search-html.php index 430bba39..c1eceede 100644 --- a/lib/template/search-html.php +++ b/lib/template/search-html.php @@ -15,63 +15,55 @@ reverse search '; - echo ''; - echo '
'; - echo '
'; - } - elseif (!empty($aMoreParams['q'])) { - echo '
'; - echo '
'; - echo '
'; - echo '
'; - } - else { - echo '
'; - echo '
'; - echo '
'; - echo '
'; - } + $bSimpleQuery = !empty($aMoreParams['q']); + $bStructuredQuery = !$bSimpleQuery + && !(empty($aMoreParams['street']) + && empty($aMoreParams['city']) + && empty($aMoreParams['county']) + && empty($aMoreParams['state']) + && empty($aMoreParams['country']) + && empty($aMoreParams['postalcode'])); ?> +
+ > + +
+
+ > + +
> - +
>
- - - - - - + + + + + +
- +
- > + >