Fixes #272 Search SQL Error

Fix for #272 / CVE-2014-1840