From f01d283b54e0899d83bc65aaa66b434209a85953 Mon Sep 17 00:00:00 2001 From: lganee Date: Mon, 7 Oct 2019 16:39:00 +0200 Subject: [PATCH] $retarray[0] may not be defined --- src/TrustedTimestamps.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TrustedTimestamps.php b/src/TrustedTimestamps.php index c27b5fe..6feac3c 100644 --- a/src/TrustedTimestamps.php +++ b/src/TrustedTimestamps.php @@ -54,12 +54,12 @@ public static function createRequestfile($hash, $hash_algo = 'sha1') $retarray = array(); exec($cmd." 2>&1", $retarray, $retcode); - + if ($retcode !== 0) { throw new Exception("OpenSSL does not seem to be installed: ".implode(", ", $retarray)); } - if (stripos($retarray[0], "openssl:Error") !== false) { + if (isset($retarray[0]) && stripos($retarray[0], "openssl:Error") !== false) { throw new Exception("There was an error with OpenSSL. Is version >= 0.99 installed?: ".implode(", ", $retarray)); }