} else if (p && *p == str[x]) {
p = NULL;
} else {
- cmd[y++] = '\\';
+ ZSTR_VAL(cmd)[y++] = '\\';
}
- cmd[y++] = str[x];
+ ZSTR_VAL(cmd)[y++] = str[x];
break;
#else
- /* % is Windows specific for environmental variables, ^%PATH% will
- /* % is Windows specific for enviromental variables, ^%PATH% will
- output PATH while ^%PATH^% will not. escapeshellcmd will escape all % and !.
++ /* % is Windows specific for environmental variables, ^%PATH% will
+ output PATH while ^%PATH^% will not. escapeshellcmd->val will escape all % and !.
*/
case '%':
case '!':
if (command_len) {
if (command_len != strlen(command)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input string contains NULL bytes");
+ php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
-- cmd = php_escape_shell_cmd(command);
-- RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
++ RETVAL_STR(php_escape_shell_cmd(command));
} else {
RETVAL_EMPTY_STRING();
}
if (argument) {
if (argument_len != strlen(argument)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input string contains NULL bytes");
+ php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
-- cmd = php_escape_shell_arg(argument);
-- RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
++ RETVAL_STR(php_escape_shell_arg(argument));
}
}
/* }}} */
}
stream = php_stream_fopen_from_pipe(in, "rb");
- total_readbytes = php_stream_copy_to_mem(stream, &ret, PHP_STREAM_COPY_ALL, 0);
+ ret = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
php_stream_close(stream);
-- if (total_readbytes > 0) {
-- RETVAL_STRINGL_CHECK(ret, total_readbytes, 0);
++ if (ret && ZSTR_LEN(ret) > 0) {
++ RETVAL_STR(ret);
}
}
/* }}} */