Skip to content

Commit f2b4eb7

Browse files
committed
PHPC-736: Remove zend_str_tolower_dup() in ObjectID construction
1 parent e40a4c6 commit f2b4eb7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/BSON/ObjectID.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,18 @@ static bool php_phongo_objectid_init(php_phongo_objectid_t *intern)
6464
* An exception will be thrown on error. */
6565
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)
6666
{
67-
char *tid = zend_str_tolower_dup(hex, hex_len);
68-
69-
if (bson_oid_is_valid(tid, hex_len)) {
67+
if (bson_oid_is_valid(hex, hex_len)) {
7068
bson_oid_t oid;
7169

72-
bson_oid_init_from_string(&oid, tid);
70+
bson_oid_init_from_string(&oid, hex);
7371
bson_oid_to_string(&oid, intern->oid);
7472
intern->initialized = true;
7573

76-
efree(tid);
7774
return true;
7875
}
7976

8077
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error parsing ObjectID string: %s", hex);
8178

82-
efree(tid);
8379
return false;
8480
}
8581

0 commit comments

Comments
 (0)