[mod] ereg_replace -> preg_replace
[mod] changed usage of function "end"