Fix inconsistent usage of strtolower

Should also fix this issue:
http://www.woltlab.com/forum/index.php/Thread/220986-SQLSTATE-HY000-General-error-1366-Incorrect-string-value-xF1a-FBI-for-column-use/