Fix for a broken query when titlesEnable is set to false - Thanks Wanchope for reporting

Signed-off-by: emanuele <emanuele45@gmail.com>
strlen of nothing is not nice. :P

Signed-off-by: emanuele <emanuele45@gmail.com>
Merge pull request #365 from emanuele45/query_fix

Fix for a broken query when titlesEnable is set to false - Thanks Wancho...