Closed Poky85 closed 6 years ago
Hello, @Poky85. Thanks for submitting the pull request.
I'll gladly accept it.
Nevertheless, could you please add a short test for this change? I guess there is some test data available in #63 already, right? This is not a show-blocker, but I would really appreciate the effort.
Thanks!
@t1gor Sure, test added in #81.
This is fix for issue #63.
Original check didn't considered rules containing
*
. So conditionif (mb_strlen($escaped) - 1 == mb_strlen($path)) {
tested exact length match between rule and path.In pull request there is added start-of-string check for rules not beginning with
*
(see robots.txt specs https://developers.google.com/search/reference/robots_txt#url-matching-based-on-path-values). Then string length condition mentioned above is no longer needed.I have fixed Composer to ~3.7 because old rule >=3.7 resolved to Composer 7 which is not compatible with tests. Upgrading tests is not in scope of this issue.