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

Fixes "case-sensitive" URI matching for Disallow rules in robots.txt #46

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

mattfo0
Copy link
Contributor

@mattfo0 mattfo0 commented Sep 18, 2024

Based on Issue #45 (Robots.txt "Disallow" URI matching should be case-sensitive) I removed the use of strtolower in parseDisallow to preserve the URI's case sensitivity.

The issue was opened based on RFC standard by google which indicates: The value of the disallow rule is case-sensitive. (Source: https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt?hl=en#disallow)


I ran PHP-Unit and all tests passed since none were specifically testing case-sensitivity. I added test the_disallows_uri_check_is_case_sensitive to cover this issue.

Based on Issue spatie#45 (Robots.txt "Disallow" URI matching should be case-sensitive) I removed the use of `strtolower` in `parseDisallow` to preserve the URI's case sensitivity.

The issue was opened based on RFC standard by google which indicates:
"The value of the disallow rule is case-sensitive."
(Source: https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt?hl=en#disallow)

---

I ran PHP-Unit and all tests passed since none were specifically testing case-sensitivity. I added test the_disallows_uri_check_is_case_sensitive to cover this issue.
Copy link
Member

@riasvdv riasvdv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the .idea files from this PR

@riasvdv riasvdv merged commit 560d6d1 into spatie:main Sep 25, 2024
7 checks passed
@riasvdv
Copy link
Member

riasvdv commented Sep 25, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants