]> granicus.if.org Git - php/commitdiff
Fix: Gracefully handle empty user input in run-tests.php
authorBerbe <4251220+Berbe@users.noreply.github.com>
Wed, 19 Aug 2020 00:44:53 +0000 (02:44 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 24 Aug 2020 09:46:01 +0000 (11:46 +0200)
Closes GH-6016.

run-tests.php

index af9f309bc6dac7ccd827ddf739fb71e6aa1945a6..8d62c8337599c650a5cb067cb568df436cba24e6 100755 (executable)
@@ -942,7 +942,7 @@ function save_or_mail_results(): void
         flush();
 
         $user_input = fgets($fp, 10);
-        $just_save_results = (strtolower($user_input[0]) == 's');
+        $just_save_results = (!empty($user_input) && strtolower($user_input[0]) === 's');
     }
 
     if ($just_save_results || !getenv('NO_INTERACTION') || TRAVIS_CI) {