Skip to content

Commit

Permalink
Use "Standard input code" instead of "php://stdin"
Browse files Browse the repository at this point in the history
  • Loading branch information
hikari-no-yume authored and krakjoe committed Nov 12, 2016
1 parent a103aa2 commit 3ed8b7a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2483,7 +2483,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file)
* otherwise it will get opened and added to the included_files list in zend_execute_scripts
*/
if (primary_file->filename &&
strcmp("php://stdin", primary_file->filename) &&
strcmp("Standard input code", primary_file->filename) &&
primary_file->opened_path == NULL &&
primary_file->type != ZEND_HANDLE_FILENAME
) {
Expand Down
2 changes: 1 addition & 1 deletion sapi/cgi/cgi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,7 @@ consult the installation file that came with this distribution, or visit \n\
file_handle.filename = SG(request_info).path_translated;
file_handle.handle.fp = NULL;
} else {
file_handle.filename = "php://stdin";
file_handle.filename = "Standard input code";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
}
Expand Down
2 changes: 1 addition & 1 deletion sapi/cgi/tests/007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ var_dump(`"$php" -n -s -w -l`);
--EXPECTF--
string(25) "No input file specified.
"
string(41) "No syntax errors detected in php://stdin
string(49) "No syntax errors detected in Standard input code
"
===DONE===
4 changes: 2 additions & 2 deletions sapi/cli/php_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
/* here but this would make things only more complicated. And it */
/* is consitent with the way -R works where the stdin file handle*/
/* is also accessible. */
file_handle.filename = "php://stdin";
file_handle.filename = "Standard input code";
file_handle.handle.fp = stdin;
}
file_handle.type = ZEND_HANDLE_FP;
Expand Down Expand Up @@ -984,7 +984,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
PG(during_request_startup) = 0;
switch (behavior) {
case PHP_MODE_STANDARD:
if (strcmp(file_handle.filename, "php://stdin")) {
if (strcmp(file_handle.filename, "Standard input code")) {
cli_register_file_handles();
}

Expand Down
2 changes: 1 addition & 1 deletion sapi/cli/tests/015.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "Done\n";
PHP %d.%d.%d%s(cli) (built: %s)%s
Array
(
[0] => php://stdin
[0] => Standard input code
[1] => foo
[2] => bar
[3] => baz
Expand Down

0 comments on commit 3ed8b7a

Please sign in to comment.