From 488db53bf7cbd90d5910838162b275f43e16363b Mon Sep 17 00:00:00 2001 From: lightray22 Date: Sun, 21 Feb 2021 20:12:26 +0000 Subject: [PATCH] fix undefined index notice in stream touch() --- phpseclib/Net/SFTP/Stream.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SFTP/Stream.php b/phpseclib/Net/SFTP/Stream.php index fb976fd0..161e734b 100644 --- a/phpseclib/Net/SFTP/Stream.php +++ b/phpseclib/Net/SFTP/Stream.php @@ -465,7 +465,9 @@ class Net_SFTP_Stream // and https://github.com/php/php-src/blob/master/main/php_streams.h#L592 switch ($option) { case 1: // PHP_STREAM_META_TOUCH - return $this->sftp->touch($path, $var[0], $var[1]); + $time = isset($var[0]) ? $var[0] : null; + $atime = isset($var[1]) ? $var[1] : null; + return $this->sftp->touch($path, $time, $atime); case 2: // PHP_STREAM_OWNER_NAME case 3: // PHP_STREAM_GROUP_NAME return false;