While doing a quick test to check against SQL injection (not exhaustive, just out of curiosity), I typed
'OR 1=1
into my search bar, and the server threw me a 406 HTTP error. I found it odd and thought it might be a SQL problem, but other cursory SQL-injection tests such as
'OR true
but the website reacted correctly and delimited the '. I feel at this point it's safe to say it's not a SQL issue, although just in case here is the php sanitizing code
$query = trim(str_replace(array('%', '_'), array('\\%', '\\_'), mysqli_real_escape_string($con, htmlspecialchars($query))));
According to a quick google search (source1, source2, source3), a 406 error is when the type of data returned does not match the HTTP request header. I find it odd that there is a type mismatch since other queries work just fine.. In fact
'OR 1 'OR 1=
both work fine (i.e. they are properly escaped). Regular search results i.e. nonmalicious ones also return properly. Any advice as to why this is happening? I am hosting using GoDaddy if that means anything.