-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Use zend_string for phar alias #17511
base: master
Are you sure you want to change the base?
Conversation
e088c3b
to
0379bbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial review, the hash_del stuff can be another PR.
// TODO: what was the point of the fname != alias check? Adding a check for the byte contents make some cache_list tests fail... | ||
if (phar_obj->archive->alias/* && !zend_string_equals_cstr(phar_obj->archive->alias, phar_obj->archive->fname, phar_obj->archive->fname_len)*/) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely, this feels like it supposed the alias shared the pointer with an fname, which seems weird. But surely if the alias is equal to the filename then it is not really an alias...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's almost as if the check is actually checking whether the alias was ever changed manually, but I'm not sure and this code has been here since the beginning. In classic PHP fashion the alias functionality is also underspecified and the impact of the branch is not tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wouldn't know the behaviour of this by any chance @theofidry ?
No description provided.