@anonymous-matomo-user opened this Issue on May 27th 2008

I'm working on my project which uses Piwik.


<?xml version="1.0" encoding="utf-8" ?><result> <error message="The url 'http://megliosoft.dyndns.org:4958/bijouterie/ab.html' is not a valid URL." /></result>

@anonymous-matomo-user commented on May 27th 2008

I researched little on this bug and I found that the problem is in
API.php:static private function isValidUrl( $url )

I fixed it temporarily on my local Piwik copy this way:

static private function isValidUrl( $url )
        $pattern = "/^((https?|ftp|gopher|telnet|file|wais):\/\/)"  
        . "(([A-z0-9_]+):([A-z0-9-_]*)@)?"  
        . "(([A-z0-9_-]+\.)*)"  
        . "(([A-z0-9-]{2,})\.)"  
        . "([A-z]{2,})"  
        . "(:(\d+))?"  
        . "((\/[a-z0-9-_.%~]*)*)?"  
        . "(\?[^? ]*)?$/";
        return preg_match($pattern, $url);

Against your coding agreements you may want to move pattern definition to some comment.

Please let me know whether this solution works for you.


@mattab commented on May 29th 2008 Member

(In [495]) - fix #5653, now allowing URLs with port

This Issue was closed on May 29th 2008
Powered by GitHub Issue Mirror