| --TEST-- | ||
| mkdir(): invalid mode | ||
| --FILE-- | ||
| <?php |
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add few more cases (e.g. -1)
Contributor Author
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
| Z_PARAM_RESOURCE_OR_NULL(zcontext) | ||
| ZEND_PARSE_PARAMETERS_END(); | ||
|
|
||
| if (mode < 0 || (mode & ~07777)) { |
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to provide a Zend API for this. As a lot of code does file permissions checks (including INI settings (or should at least))
Contributor Author
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve created a helper function zend_validate_file_permissions(). I think this can be used to validate permission masks for any filesystem-related operations. Please let me know if this approach makes sense.