Skip to content

lexbor: Merge upstream fixes (8.5) - #23660

Open
alexandre-daubois wants to merge 1 commit into
php:PHP-8.5from
alexandre-daubois:lexbor-fix-8.5
Open

lexbor: Merge upstream fixes (8.5)#23660
alexandre-daubois wants to merge 1 commit into
php:PHP-8.5from
alexandre-daubois:lexbor-fix-8.5

Conversation

@alexandre-daubois

@alexandre-daubois alexandre-daubois commented Sep 11, 2026

Copy link
Copy Markdown
Member

Once this one and #23659 are merged, I'll have a look to actually bump lexbor to 3.0.1 on master.

@alexandre-daubois alexandre-daubois changed the title lexbor: Merge upstream memory safety fixes 859f100, 8a14bc0, f67ce4b and b0f7412 lexbor: Merge upstream fixes (8.5) Sep 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW: Historically we didn't add tests for upstream issues (because the fix is already tested upstream), so for all I care these can be dropped.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW: I'm happy with these tests, because these make sure that no matter which library or library version we use under the hood, the asserted edge cases satisfy the related specifications, and most tests already check lexbor's and uriparser's own behavior, not just the php-src integration.

--FILE--
<?php

$url = Uri\WhatWg\Url::parse("https://" . str_repeat("é", 5000) . ".com/");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
$url = Uri\WhatWg\Url::parse("https://" . str_repeat("é", 5000) . ".com/");
$url = new Uri\WhatWg\Url("https://" . str_repeat("é", 5000) . ".com/");

If this test is kept, use the throwing variant of the constructor (makes it easier to debug when parsing fails).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I see that this is consistent with existing tests. Perhaps we should adjust that for all tests. What do you think @kocsismate?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I was also thinking about changing most test to use the constructor, except for a few which make sure that parse() also works as intended ^^

@kocsismate

Copy link
Copy Markdown
Member

@alexandre-daubois FYI: lexbor/lexbor#396 is another candidate which should also land when merged.

@alexandre-daubois

Copy link
Copy Markdown
Member Author

Thanks Máté! Keeping an eye on it

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.

3 participants