Skip to content

ext/standard: Stop get_browser() looping on browscap parent cycles - #339

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-lbvd
Closed

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-lbvd

Conversation

@iliaal

@iliaal iliaal commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Terminate inherited-parent traversal when browscap data contains a cycle while preserving valid parent chains. The regression test covers cyclic parent metadata.

@iliaal
iliaal changed the base branch from master to PHP-8.4 September 24, 2026 13:00
The browscap loader rejects an entry that names itself as Parent, but a
longer cycle such as A -> B -> C -> A loads fine, and get_browser() then
followed it forever. get_browser() now records the entries it has
visited and stops at the first repeat, so an entry in a cycle, or one
whose chain leads into a cycle, still gets the properties of every
distinct ancestor with the closest one winning.
@iliaal iliaal changed the title ext/standard: Stop browscap parent cycles ext/standard: Stop get_browser() looping on browscap parent cycles Oct 4, 2026
@iliaal

iliaal commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#24127.

@iliaal iliaal closed this Oct 4, 2026
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.

1 participant