Skip to content

Commit 0cbea72

Browse files
committed
Convert E_ERROR to ValueError in php_escape_shell_arg()
1 parent 93df9c1 commit 0cbea72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/standard/exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ PHPAPI zend_string *php_escape_shell_arg(const zend_string *unescaped_arg)
402402

403403
/* max command line length - two single quotes - \0 byte length */
404404
if (l > cmd_max_len - 2 - 1) {
405-
php_error_docref(NULL, E_ERROR, "Argument exceeds the allowed length of %zu bytes", cmd_max_len);
405+
zend_value_error("Argument exceeds the allowed length of %zu bytes", cmd_max_len);
406406
return ZSTR_EMPTY_ALLOC();
407407
}
408408

@@ -461,7 +461,7 @@ PHPAPI zend_string *php_escape_shell_arg(const zend_string *unescaped_arg)
461461
ZSTR_VAL(cmd)[y] = '\0';
462462

463463
if (y > cmd_max_len + 1) {
464-
php_error_docref(NULL, E_ERROR, "Escaped argument exceeds the allowed length of %zu bytes", cmd_max_len);
464+
zend_value_error("Escaped argument exceeds the allowed length of %zu bytes", cmd_max_len);
465465
zend_string_release_ex(cmd, 0);
466466
return ZSTR_EMPTY_ALLOC();
467467
}

0 commit comments

Comments
 (0)