[wp-testers] function clean_url, esc_url, urlencode

Andrew Nacin wp at andrewnacin.com
Tue May 18 05:43:05 UTC 2010


clean_url and esc_url are the same function. In 3.0, esc_url is considered
canonical and clean_url is officially deprecated.

esc_url makes sure it is a valid URL, and escaped for output, generally into
an HTML attribute. Its job is to ensure that the URL is safe, thus
eliminating XSS attack vectors.

In this case, the URL you are passing is technically invalid. You must
encode the spaces yourself.


More information about the wp-testers mailing list