From 6529870c449d426d645115d3f35191c4b2023340 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 29 Jul 2015 22:56:42 +0200 Subject: [PATCH] tweeper: avoid a reference to $argv in non-cli mode $argv is not defined in non-cli mode, so protect its usage behind an is_cli() check. For instance, this avoids a message in the PHP built-in web server, when usage() gets called: PHP Notice: Undefined variable: argv in .../tweeper.php on line 357 --- tweeper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tweeper.php b/tweeper.php index f07382b..a9fce9b 100644 --- a/tweeper.php +++ b/tweeper.php @@ -354,7 +354,7 @@ if (is_cli()) { } if (!isset($options['src_url'])) { - fwrite($ERROR_STREAM, usage($argv)); + fwrite($ERROR_STREAM, usage(is_cli() ? $argv : NULL)); exit(1); } -- 2.1.4