Blank keywords results in php error
submitting the search form with the keywords field blank results in the following php error:
A PHP Error was encountered
Severity: Warning
Message: htmlspecialchars() expects parameter 1 to be string, array given
Filename: helpers/low_search_helper.php
Line Number: 346
i've changed to this which works as a temporary fix:
$str = @htmlspecialchars($str);
LS v2.3.1
EE v2.1.6
Replies
Low 30 Jul 2013 16:03
Hey Ben,
Can't seem to replicate this. Are you sure you're using EE v2.1.6 (instead of 2.6.1)?
Can you paste the URL that generates the error here?
Ben Croker 30 Jul 2013 16:06
yeah i meant 2.6.1
i can't share the url publicly but will email it to you
thanks low!
Ben Croker 30 Jul 2013 16:11
ah i forgot to mention that i'm using Publisher and this extension:
https://github.com/litzinger/publishe...
Low 30 Jul 2013 16:15
Aha! That'll be the culprit, probably. Have you asked Brian about this?
Ben Croker 30 Jul 2013 16:21
i've asked him to take a look, will let you know what happens. thanks!
Ben Croker 31 Jul 2013 11:32
brian reckons it's nothing to do with his extension. i'll use the temporary fix i have above for now.
cheers!
Ben Croker 31 Jul 2013 11:54
hey low, i noticed this is in the code in ext.low_search.php:
the conditional "if ($str[1] === TRUE)" throws an error since you set "$str" to be a string on the line before. can you please look into this?
Low 31 Jul 2013 17:09
Change that into this, perhaps:
I can look into it in more detail next week when I'm back from my holiday. :)
Ben Croker 31 Jul 2013 19:02
yeah i just noticed it as a bug while looking through the code. no rush at all on this, enjoy the hols!!
Low 6 Sep 2013 13:57
Ben, for a better fix (which I haven't yet added to the core) open up ext.low_search.php and look up these lines (around #323 in v2.4.1):
Change that to
Ben Croker 6 Sep 2013 14:30
i'll try it out, thanks