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("ä", "ö", "å", "Ä", "Ö", "Å"); $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); ?>