-
-
Couldn't load subscription status.
- Fork 317
Fix the subdomain detection, substr was using a wrong offset length #556
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
$host = "sub.example.com", $adapterHost = "example.com":
Original: substr("sub.example.com", -11 + 1) = "xample.com" vs .example.com → false.
Modified: substr("sub.example.com", -11 - 1) = ".example.com" vs .example.com → true.
The change fixes the subdomain check by adjusting the substring start position to include the leading dot, ensuring accurate detection of subdomains.
Thank you @edhelas for the change and @Vitorinox for the review!
Everything is in the title :)