Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piwik does not recognize URL of site when creating new one #5653

Closed
anonymous-matomo-user opened this issue May 27, 2008 · 2 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Milestone

Comments

@anonymous-matomo-user
Copy link

I’m working on my project which uses Piwik.

Call:
http://megliosoft.dyndns.org:4958/pwtransl/?module=API&method=SitesManager.addSite&siteName=r9&urls=http://megliosoft.dyndns.org:4958/books/abc.html&token_auth=….

Error:
<?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
Copy link
Author

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.

Thanks,
Anton

@mattab
Copy link
Member

mattab commented May 29, 2008

(In 495) – fix #5653, now allowing URLs with port

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Projects
None yet
Development

No branches or pull requests

2 participants