fixed format issue if input has % by escaping

If an input field already has % in the string, after sprintf the error message will look like
array[0 => 1]

This str_replace escapes it and fixes the issue.