Juho was skimming around code, searching for a bug, when saw the following PHP code. In my opinion, its purpose was probably as a workaround for a bug in MySQL 5.0. I mean, I hope it was.

At least the original author knew it was bad code.

<?php
/**Extremely retarded replace for getting rid of entities of scandinavian characters => text searches won't work.. 
 * 
 * See you @ www.thedailywtf.com
 */

$entities_to_replace=array("&auml;", "&ouml;", "&aring;",   "&Auml;", "&Ouml;", "&Aring;");
$clean_values = array(chr(228), chr(246), chr(229), chr(196), chr(214), chr(197));

$field_db_value = str_replace($entities_to_replace, $clean_values, $field_db_value);
?>
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!