Skip to content

Commit 6711785

Browse files
committed
Add quotes arround command name
1 parent 126cecd commit 6711785

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/standard/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,15 +954,15 @@ PHP_FUNCTION(popen)
954954

955955
fp = VCWD_POPEN(command, posix_mode);
956956
if (!fp) {
957-
php_error_docref(NULL, E_WARNING, "%s with command %s and POSIX mode %s", strerror(errno), command, posix_mode);
957+
php_error_docref(NULL, E_WARNING, "%s with command \"%s\" and POSIX mode %s", strerror(errno), command, posix_mode);
958958
efree(posix_mode);
959959
RETURN_FALSE;
960960
}
961961

962962
stream = php_stream_fopen_from_pipe(fp, mode);
963963

964964
if (stream == NULL) {
965-
php_error_docref(NULL, E_WARNING, "%s with command %s and mode %s", strerror(errno), command, mode);
965+
php_error_docref(NULL, E_WARNING, "%s with command \"%s\" and mode %s", strerror(errno), command, mode);
966966
RETVAL_FALSE;
967967
} else {
968968
php_stream_to_zval(stream, return_value);

ext/standard/tests/file/popen_pclose_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ NULL
4040
Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d
4141
NULL
4242

43-
Warning: popen(): Invalid argument with command abc.txt and POSIX mode rw in %s on line %d
43+
Warning: popen(): Invalid argument with command "abc.txt" and POSIX mode rw in %s on line %d
4444
bool(false)
4545

4646
Warning: pclose() expects exactly 1 parameter, 0 given in %s on line %d

0 commit comments

Comments
 (0)