From b32bb29e5c96d0ff8280b61346fbb8ba70babf7c Mon Sep 17 00:00:00 2001 From: Hans Chen Date: Tue, 16 Apr 2013 15:10:00 +0200 Subject: [PATCH] langcheck will give correct instruciton if the language parameter is added with php extension --- lang/langcheck | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/langcheck b/lang/langcheck index 78f91e4f..1565c4fa 100644 --- a/lang/langcheck +++ b/lang/langcheck @@ -12,7 +12,9 @@ if (!ini_get('safe_mode')) set_time_limit(0); // Check arguments - if (sizeof($_SERVER['argv']) != 2) { + if (sizeof($_SERVER['argv']) != 2 or ( + is_file($_SERVER['argv'][1]) ? ( + substr_compare(pathinfo($_SERVER['argv'][1], PATHINFO_EXTENSION), "php", 0, 3, FALSE) == 0 ? TRUE : FALSE) : FALSE )) { echo "Usage: langcheck \n\n"; echo " is the filename without the .php extension\n"; exit; -- 2.39.5