Replace deprecated use of ereg_replace with str_replace.