/ext/standard: Check for empty string in linkinfo()#21793
/ext/standard: Check for empty string in linkinfo()#21793LamentXU123 wants to merge 4 commits intophp:masterfrom
Conversation
AFAIK This can be fixed inside the |
I don't want to pass the argnum to a Zend API, it is better to enforce the semantics at the call site as I can't imagine most use sites of this API have empty strings. |
Girgias
left a comment
There was a problem hiding this comment.
UPGRADING also needs to be updated.
| try { | ||
| var_dump(linkinfo(false)); // boolean false as linkname | ||
| } catch (ValueError $e) { | ||
| echo $e->getMessage() . "\n"; | ||
| } |
There was a problem hiding this comment.
This is a ZPP test, please remove.
If link_len == 0, it now emits the same warning style as the existing filesystem error path and returns -1 immediately, avoiding the later estrndup() / zend_dirname() work on an empty input as per the TODO message.