Conversation
NickSdot
force-pushed
the
fix/uri-builder-empty-credentials
branch
from
September 21, 2026 11:00
366dd11 to
98fe5c5
Compare
NickSdot
marked this pull request as ready for review
September 22, 2026 01:55
kocsismate
reviewed
Sep 24, 2026
|
|
||
| static const size_t lexbor_mraw_byte_size = 8192; | ||
|
|
||
| ZEND_ATTRIBUTE_NONNULL static zend_always_inline bool zval_string_or_null_is_non_empty(const zval *value) |
Member
There was a problem hiding this comment.
I think in this case it doesn't matter if value can be null or not:
Suggested change
| ZEND_ATTRIBUTE_NONNULL static zend_always_inline bool zval_string_or_null_is_non_empty(const zval *value) | |
| ZEND_ATTRIBUTE_NONNULL static zend_always_inline bool zval_string_is_non_empty(const zval *value) |
But I'm not really sure that this needs to be extracted at all. This code is trivial; what's not trivial is when the non-empty check should be used: in case of the username and port setters which remove the component in question in case of an empty input.
| @@ -0,0 +1,50 @@ | |||
| --TEST-- | |||
| Test Uri\WhatWg\UrlBuilder::setPassword() - success - empty string with empty host and file base URL | |||
Member
There was a problem hiding this comment.
apparently there are way too many file tests. is it really needed to have all?
and I miss two tests:
$base = new Uri\WhatWg\Url('https://user:pass@example.com/path');
echo new Uri\WhatWg\Url('', $base)->toAsciiString();
// https://user:pass@example.com/path
$base = new Uri\WhatWg\Url('https://user:pass@example.com/path');
echo $base->withPassword('')->toAsciiString();
// https://user@example.com/path
Contributor
Author
There was a problem hiding this comment.
Added, and removed.
Contributor
Author
|
Failures unrelated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.