Skip to content

Commit c529e2f

Browse files
committed
ext/session: Use smart_str_append when possible
1 parent eaee504 commit c529e2f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/session/session.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ PS_SERIALIZER_ENCODE_FUNC(php_binary)
992992
PS_ENCODE_LOOP(
993993
if (ZSTR_LEN(key) > PS_BIN_MAX) continue;
994994
smart_str_appendc(&buf, (unsigned char)ZSTR_LEN(key));
995-
smart_str_appendl(&buf, ZSTR_VAL(key), ZSTR_LEN(key));
995+
smart_str_append(&buf, key);
996996
php_var_serialize(&buf, struc, &var_hash);
997997
);
998998

@@ -1054,7 +1054,7 @@ PS_SERIALIZER_ENCODE_FUNC(php)
10541054
PHP_VAR_SERIALIZE_INIT(var_hash);
10551055

10561056
PS_ENCODE_LOOP(
1057-
smart_str_appendl(&buf, ZSTR_VAL(key), ZSTR_LEN(key));
1057+
smart_str_append(&buf, key);
10581058
if (memchr(ZSTR_VAL(key), PS_DELIMITER, ZSTR_LEN(key))) {
10591059
PHP_VAR_SERIALIZE_DESTROY(var_hash);
10601060
smart_str_free(&buf);
@@ -1397,7 +1397,7 @@ static zend_result php_session_send_cookie(void)
13971397
smart_str_appendl(&ncookie, "Set-Cookie: ", sizeof("Set-Cookie: ")-1);
13981398
smart_str_appendl(&ncookie, PS(session_name), strlen(PS(session_name)));
13991399
smart_str_appendc(&ncookie, '=');
1400-
smart_str_appendl(&ncookie, ZSTR_VAL(e_id), ZSTR_LEN(e_id));
1400+
smart_str_append(&ncookie, e_id);
14011401

14021402
zend_string_release_ex(e_id, 0);
14031403

@@ -1411,7 +1411,7 @@ static zend_result php_session_send_cookie(void)
14111411
if (t > 0) {
14121412
date_fmt = php_format_date("D, d M Y H:i:s \\G\\M\\T", sizeof("D, d M Y H:i:s \\G\\M\\T")-1, t, 0);
14131413
smart_str_appends(&ncookie, COOKIE_EXPIRES);
1414-
smart_str_appendl(&ncookie, ZSTR_VAL(date_fmt), ZSTR_LEN(date_fmt));
1414+
smart_str_append(&ncookie, date_fmt);
14151415
zend_string_release_ex(date_fmt, 0);
14161416

14171417
smart_str_appends(&ncookie, COOKIE_MAX_AGE);
@@ -1523,7 +1523,7 @@ PHPAPI zend_result php_session_reset_id(void)
15231523

15241524
smart_str_appends(&var, PS(session_name));
15251525
smart_str_appendc(&var, '=');
1526-
smart_str_appends(&var, ZSTR_VAL(PS(id)));
1526+
smart_str_append(&var, PS(id));
15271527
smart_str_0(&var);
15281528
if (sid) {
15291529
zval_ptr_dtor(sid);

0 commit comments

Comments
 (0)