Skip to content

Commit

Permalink
Security measure to cover a possibility related to a library.
Browse files Browse the repository at this point in the history
Serious actors may wish to do a hot-fix but no known attacks observed yet.

hafriedlander/php-peg#39
  • Loading branch information
aharjula committed Nov 8, 2019
1 parent 1e1aa36 commit 8b36bc2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions thirdparty/php-peg/cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@

use hafriedlander\Peg\Compiler;

// Just in case this matters.
/// https://github.com/hafriedlander/php-peg/issues/39
if (php_sapi_name() != "cli") {
die("Maybe bad...");
}

Compiler::cli( $_SERVER['argv'] ) ;

1 comment on commit 8b36bc2

@aharjula
Copy link
Member Author

@aharjula aharjula commented on 8b36bc2 Nov 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those wondering if this is something to worry about, my feeling is that it is not, unless you know that your server has register_argc_argv turned on in its PHP.ini. By default it seems to be off for most sane distributions.

Please sign in to comment.