fix replaceAll()

This function will never return if new_value contains old_value.
For example, old_value = "'", new_value = "''".
Merge pull request #7791 from xiangxw/fix_replaceAll

fix replaceAll()