From 8b36bc2390fd68e3e289b96c874801ed61d1276a Mon Sep 17 00:00:00 2001 From: Matti Harjula Date: Fri, 8 Nov 2019 12:31:39 +0200 Subject: [PATCH] Security measure to cover a possibility related to a library. Serious actors may wish to do a hot-fix but no known attacks observed yet. https://github.com/hafriedlander/php-peg/issues/39 --- thirdparty/php-peg/cli.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/thirdparty/php-peg/cli.php b/thirdparty/php-peg/cli.php index 5a2b3c703f2..1bfb0322a33 100644 --- a/thirdparty/php-peg/cli.php +++ b/thirdparty/php-peg/cli.php @@ -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'] ) ;