You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/MongoDB/WriteConcern.c
+34-34Lines changed: 34 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -66,14 +66,19 @@ static bool php_phongo_writeconcern_init_from_hash(php_phongo_writeconcern_t* in
66
66
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" integer field to be >= 0", ZSTR_VAL(php_phongo_writeconcern_ce->name));
67
67
goto failure;
68
68
}
69
-
if (Z_LVAL_P(wtimeout) >INT32_MAX) {
70
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_writeconcern_ce->name), INT32_MAX);
if (!php_phongo_parse_int64(&timeout, Z_STRVAL_P(wtimeout), Z_STRLEN_P(wtimeout))) {
75
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Error parsing \"%s\" as 64-bit value for %s initialization", Z_STRVAL_P(wtimeout), ZSTR_VAL(php_phongo_writeconcern_ce->name));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" field to be integer", ZSTR_VAL(php_phongo_writeconcern_ce->name));
81
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" field to be integer or string", ZSTR_VAL(php_phongo_writeconcern_ce->name));
77
82
goto failure;
78
83
}
79
84
}
@@ -116,14 +121,19 @@ static bool php_phongo_writeconcern_init_from_hash(php_phongo_writeconcern_t* in
116
121
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" integer field to be >= 0", ZSTR_VAL(php_phongo_writeconcern_ce->name));
117
122
goto failure;
118
123
}
119
-
if (Z_LVAL_PP(wtimeout) >INT32_MAX) {
120
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_writeconcern_ce->name), INT32_MAX);
if (!php_phongo_parse_int64(&timeout, Z_STRVAL_PP(wtimeout), Z_STRLEN_PP(wtimeout))) {
130
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Error parsing \"%s\" as 64-bit value for %s initialization", Z_STRVAL_PP(wtimeout), ZSTR_VAL(php_phongo_writeconcern_ce->name));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" field to be integer", ZSTR_VAL(php_phongo_writeconcern_ce->name));
136
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"wtimeout\" field to be integer or string", ZSTR_VAL(php_phongo_writeconcern_ce->name));
0 commit comments