Reorganize conditional to avoid crashes
This commit is contained in:
@@ -9,8 +9,10 @@
|
||||
<form method="GET" action="/search" >
|
||||
<div class="eight columns" >
|
||||
<%
|
||||
let search = typeof q == 'undefined' ? '' : q;
|
||||
search = htmlEscape(q).replace(/\+/g, ' ')
|
||||
let search = ''
|
||||
if (typeof q == 'undefined') {
|
||||
search = htmlEscape(q).replace(/\+/g, ' ')
|
||||
}
|
||||
%>
|
||||
<input type="text" name="q" value="<%- search %>" class="u-full-width" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user