Skip to content

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

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

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

Conversation

@iliaal

@iliaal iliaal commented Oct 4, 2026

Copy link
Copy Markdown
Member

The browscap loader already rejects an entry that is its own parent, but a longer cycle (A -> B -> C -> A) loads fine and get_browser() then follows it forever. get_browser() now remembers which entries it has visited and stops at the first repeat.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant