The FILTER_VALIDATE_URL
filter seems to have some trouble validating non-ASCII URLs:
var_dump(filter_var('http://pt.wikipedia.org/wiki/', FILTER_VALIDATE_URL)); // http://pt.wikipedia.org/wiki/
var_dump(filter_var('http://pt.wikipedia.org/wiki/Guimar?es', FILTER_VALIDATE_URL)); // false
Why isn't the last URL correctly validated? And what are the possible workarounds? Running PHP 5.3.0.
I'd also like to know where I can find the source code of the FILTER_VALIDATE_URL
validation filter.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…