[wp-testers] function clean_url, esc_url, urlencode

Philip M. Hofer (Frumph) philip at frumph.net
Tue May 18 05:29:45 UTC 2010


Hrm.. having difficulty with the above functions with WP.

This is the generic $file_url i'm using:

string(71) http://anomaly.frumph.net/files/comics/2009-05-26-Meandering Part 2.jpg

This is with clean_url()

 string(69) http://anomaly.frumph.net/files/comics/2009-05-26-MeanderingPart2.jpg

Notice the spaces just got removed with clean_url()

Now this is with urlencode()

string(83) "http%3A%2F%2Fanomaly.frumph.net%2Ffiles%2Fcomics%2F2009-05-26-Meandering+Part+2.jpg"

Notice the spaces are now + 's

This is with esc_url()

string(69) http://anomaly.frumph.net/files/comics/2009-05-26-MeanderingPart2.jpg 

It's just like clean_url where the spaces are completely gone and not really making it browser friendly %'s, so there's definately a problem there.

- Phil





More information about the wp-testers mailing list