chuushi / CoreProtect-Lookup-Web-Interface

A flexible lookup web interface for CoreProtect 2
MIT License
50 stars 14 forks source link

fix sizeof warning, which triggered SyntaxError: Unexpected token error #29

Closed granny closed 3 years ago

granny commented 4 years ago

Closes #28 Not sure if there were any other warnings/errors that could've been the cause. This was what made it work for me. Found the issue by logging the xhr output from the xhrError function in main.js, with the output in responseText having:

<b>Warning</b>:  sizeof(): Parameter must be an array or an object that implements Countable in <b>/www/public/lookup.php</b> on line <b>158</b><br />
<b>Warning</b>:  sizeof(): Parameter must be an array or an object that implements Countable in <b>/www/public/lookup.php</b> on line <b>160</b><br />
<b>Warning</b>:  sizeof(): Parameter must be an array or an object that implements Countable in <b>/www/public/lookup.php</b> on line <b>161</b><br />

Would definitely recommend better logging for end-users, or at-least an error in the console showing the responseText in case something similar happens again.

chuushi commented 3 years ago

Hi @granny, thank you for the PR! I'm sorry I noticed it only today ;w;