t1gor / Robots.txt-Parser-Class

Php class for robots.txt parse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Correct $url argument

stanislav-reshetnev opened this issue · comments

Please rename $url argument of RobotsTxtParser::isAllowed().
It's not URL but URL-path. We need to pass the path part of URL, not whole URL.

For example, we have the rule:
Disallow: /
It will be converted to 'rules' => ('disallow' => '/.*')
And if we wll pass $url = 'http://domain.com/path/file' to isAllowed(), it wouldn't work properly.
Or You must detect URLs with protocol and hostname assigned in $url.