File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -62,24 +62,20 @@ static bool php_phongo_objectid_init(php_phongo_objectid_t *intern)
62
62
63
63
/* Initialize the object from a hex string and return whether it was successful.
64
64
* An exception will be thrown on error. */
65
- static bool php_phongo_objectid_init_from_hex_string (php_phongo_objectid_t * intern , const char * oid , phongo_zpp_char_len oid_len TSRMLS_DC )
65
+ static bool php_phongo_objectid_init_from_hex_string (php_phongo_objectid_t * intern , const char * hex , phongo_zpp_char_len hex_len TSRMLS_DC )
66
66
{
67
- char * tid = zend_str_tolower_dup (oid , oid_len );
68
-
69
- if (bson_oid_is_valid (tid , oid_len )) {
67
+ if (bson_oid_is_valid (hex , hex_len )) {
70
68
bson_oid_t oid ;
71
69
72
- bson_oid_init_from_string (& oid , tid );
70
+ bson_oid_init_from_string (& oid , hex );
73
71
bson_oid_to_string (& oid , intern -> oid );
74
72
intern -> initialized = true;
75
73
76
- efree (tid );
77
74
return true;
78
75
}
79
76
80
- phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC , "Error parsing ObjectID string: %s" , oid );
77
+ phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC , "Error parsing ObjectID string: %s" , hex );
81
78
82
- efree (tid );
83
79
return false;
84
80
}
85
81
You can’t perform that action at this time.
0 commit comments