F0("unlink", MAY_BE_FALSE | MAY_BE_TRUE),
F1("exec", MAY_BE_FALSE | MAY_BE_STRING),
F1("system", MAY_BE_FALSE | MAY_BE_STRING),
- F1("escapeshellcmd", MAY_BE_NULL | MAY_BE_STRING),
- F1("escapeshellarg", MAY_BE_NULL | MAY_BE_STRING),
+ F1("escapeshellcmd", MAY_BE_STRING),
+ F1("escapeshellarg", MAY_BE_STRING),
F1("passthru", MAY_BE_NULL | MAY_BE_FALSE),
F1("shell_exec", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
if (command_len) {
if (command_len != strlen(command)) {
- php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
+ zend_type_error("Input string contains NULL bytes");
return;
}
RETVAL_STR(php_escape_shell_cmd(command));
Z_PARAM_STRING(argument, argument_len)
ZEND_PARSE_PARAMETERS_END();
- if (argument) {
- if (argument_len != strlen(argument)) {
- php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
- return;
- }
- RETVAL_STR(php_escape_shell_arg(argument));
+ if (argument_len != strlen(argument)) {
+ zend_type_error("Input string contains NULL bytes");
+ return;
}
+
+ RETVAL_STR(php_escape_shell_arg(argument));
}
/* }}} */
?>
===DONE===
--EXPECTF--
-Fatal error: escapeshellarg(): Input string contains NULL bytes in %s on line %d
+Fatal error: Uncaught TypeError: Input string contains NULL bytes in %s:%d
+Stack trace:
+#0 %s(%d): escapeshellarg('hello\x00world')
+#1 {main}
+ thrown in %s on line %d
?>
===DONE===
--EXPECTF--
-Fatal error: escapeshellcmd(): Input string contains NULL bytes in %s on line %d
+Fatal error: Uncaught TypeError: Input string contains NULL bytes in %s:%d
+Stack trace:
+#0 %s(%d): escapeshellcmd('hello\x00world')
+#1 {main}
+ thrown in %s on line %d