ZEND_RESULT_CODE php_http_message_body_add_form_field(php_http_message_body_t *body, const char *name, const char *value_str, size_t value_len)
{
- zend_string *safe_name;
+ zend_string *safe_name = zend_string_init(name, strlen(name), 0);
- safe_name = php_addslashes(estrdup(name), strlen(name), 1);
+ safe_name = php_addslashes(safe_name, 1);
BOUNDARY_OPEN(body);
php_http_message_body_appendf(
{
size_t path_len = strlen(path);
char *path_dup = estrndup(path, path_len);
- zend_string *safe_name, *base_name;
+ zend_string *base_name, *safe_name = zend_string_init(name, strlen(name), 0);
- safe_name = php_addslashes(estrdup(name), strlen(name), 1);
+ safe_name = php_addslashes(safe_name, 1);
base_name = php_basename(path_dup, path_len, NULL, 0);
BOUNDARY_OPEN(body);
ZVAL_STR(zv, php_http_cs2zs(deq, deq_len));
}
- php_stripcslashes(Z_STRVAL_P(zv), &Z_STRLEN_P(zv));
+ php_stripcslashes(Z_STR_P(zv));
}
static inline void prepare_escaped(zval *zv)
{
if (Z_TYPE_P(zv) == IS_STRING) {
size_t len = Z_STRLEN_P(zv);
- zend_string *stripped = php_addcslashes(Z_STRVAL_P(zv), Z_STRLEN_P(zv), 0,
+ zend_string *stripped = php_addcslashes(Z_STR_P(zv), 0,
ZEND_STRL("\0..\37\173\\\""));
if (len != stripped->len || strpbrk(stripped->val, "()<>@,;:\"[]?={} ")) {