-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix UNKNOWN default values in ext/oci8 #6089
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
Conversation
@cjbj Can you help us get this PR tested since we have no (easy) way to test these changes? |
@kocsismate I'm happy to help, and appreciate the PR. Can you describe the problem you are solving - I haven't dug into stubs a lot. |
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.
With the syntax corrected, tests results are the same as previously.
ext/oci8/oci8_interface.c
Outdated
if (!getThis() && ZEND_NUM_ARGS() > 2 && length < 0) { | ||
if (length_is_null) { | ||
length = -1; | ||
else if (length < 0) { |
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.
This needs a closing brace for the first clause:
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -641,7 +641,7 @@ PHP_FUNCTION(oci_lob_erase)
if (length_is_null) {
length = -1;
- else if (length < 0) {
+ } else if (length < 0) {
php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
RETURN_FALSE;
}
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.
Uhh :/
8fa61ed
to
bbeee5a
Compare
@cjbj Thank you very much for the help!
The reason of these changes is that the functions which are marked with an |
Thanks for the info and PR. LGTM. |
ext/oci8/oci8_interface.c
Outdated
@@ -757,9 +749,10 @@ PHP_FUNCTION(oci_lob_copy) | |||
{ | |||
zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from; | |||
php_oci_descriptor *descriptor_dest, *descriptor_from; | |||
zend_long length = 0; | |||
zend_long length = -1; |
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.
Don't we have the same issue with the default value here?
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.
Yes, I didn't notice it
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.
I fixed the same problem in oci_lob_export()
as well.
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.
This looks right to me now.
No description provided.