Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
oscarotero merged 1 commit into php-embed:master from edhelas:master
May 13, 2025

Conversation

@edhelas
Copy link
Contributor

@edhelas edhelas commented May 13, 2025

Everything is in the title :)

Copy link
Collaborator

@Vitorinox Vitorinox left a comment
edited
Loading

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.

@oscarotero oscarotero merged commit ede1676 into php-embed:master May 13, 2025
Copy link
Collaborator

Thank you @edhelas for the change and @Vitorinox for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Vitorinox Vitorinox Vitorinox approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /