Paul
Wed 28th May '03, 2:54pm
Hi all,
There's a small bug in the regex that checks for the presence of a protocol defined in a url.
in admin/functions.php:
if(!preg_match("![a-z]://!si", $url)) {
will match any instance of "<alphacharacter>://" anywhere in a URL. This means that urls entered into a post such as:
www.some.site/view?http://www.another.site (note the lack of a http:// prefix)
.. will NOT be prefixed with "http://" and will pass the regex.
It should be:
if(!preg_match("!^[a-z]+://!si", $url)) {
Best wishes,
Paul
There's a small bug in the regex that checks for the presence of a protocol defined in a url.
in admin/functions.php:
if(!preg_match("![a-z]://!si", $url)) {
will match any instance of "<alphacharacter>://" anywhere in a URL. This means that urls entered into a post such as:
www.some.site/view?http://www.another.site (note the lack of a http:// prefix)
.. will NOT be prefixed with "http://" and will pass the regex.
It should be:
if(!preg_match("!^[a-z]+://!si", $url)) {
Best wishes,
Paul