-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix ZPP for mhash() #5985
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
Fix ZPP for mhash() #5985
Conversation
I think it would be better to extract a version of php_hash_do_hash/_hmac without the zpp code (accepting the already parsed parameters and algorithm). |
The main reason why I chose this quick and dirty solution is that the two variants expect different number of parameters:
So similar to the Besides, the |
@kocsismate As mhash does not accept the raw_output parameter, I think the signature should be pretty clean: |
@nikic I've just pushed a commit which refactors these functions. I quite much like the end result. Thanks for pushing for it :) |
size_t data_len; | ||
zend_bool raw_output = raw_output_default; | ||
static void php_hash_do_hash( | ||
zval *return_value, zend_string *algo, char *data, size_t data_len, zend_bool raw_output, int isfilename |
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.
zval *return_value, zend_string *algo, char *data, size_t data_len, zend_bool raw_output, int isfilename | |
zval *return_value, zend_string *algo, char *data, size_t data_len, zend_bool raw_output, bool isfilename |
Maybe?
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.
Makes sense for me, so I applied this change to master.
Related to #5881