Skip to content

Commit

Permalink
Provide default for parse_str to avoid error message with no URL query
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Dec 11, 2024
1 parent 5a4c696 commit bc53731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/frontend/components/searchForm_simple.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{if !$currentJournal || $currentJournal->getData('publishingMode') != $smarty.const.PUBLISHING_MODE_NONE}
{capture name="searchFormUrl"}{url page="search" op="search" escape=false}{/capture}
{assign var=formUrlParameters value=[]}{* Prevent Smarty warning *}
{$smarty.capture.searchFormUrl|parse_url:$smarty.const.PHP_URL_QUERY|parse_str:$formUrlParameters}
{$smarty.capture.searchFormUrl|parse_url:$smarty.const.PHP_URL_QUERY|default:""|parse_str:$formUrlParameters}
<form class="pkp_search {$className|escape}" action="{$smarty.capture.searchFormUrl|strtok:"?"|escape}" method="get" role="search" aria-label="{translate|escape key="submission.search"}">
{foreach from=$formUrlParameters key=paramKey item=paramValue}
<input type="hidden" name="{$paramKey|escape}" value="{$paramValue|escape}"/>
Expand Down

0 comments on commit bc53731

Please sign in to comment.