diff --git a/.travis.yml b/.travis.yml index 9a402e4a..125406fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ php: - 5.5.9 - 5.5 - 5.6 - - hhvm env: global: @@ -18,7 +17,13 @@ env: before_install: true install: - - sudo apt-get install parallel + - wget http://ftp.gnu.org/gnu/parallel/parallel-20120522.tar.bz2 + - tar -xvjf parallel* + - cd parallel* + - ./configure + - make + - sudo make install + - cd .. - eval `ssh-agent -s` - travis/setup-secure-shell.sh - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/install-php-extensions.sh; fi" diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 1e815e0e..7cde0875 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3880,7 +3880,11 @@ class Net_SSH2 */ function getLastError() { - return $this->errors[count($this->errors) - 1]; + $count = count($this->errors); + + if ($count > 0) { + return $this->errors[$count - 1]; + } } /** diff --git a/tests/Unit/File/ASN1Test.php b/tests/Unit/File/ASN1Test.php index 2a6c4d63..fe0e01b4 100644 --- a/tests/Unit/File/ASN1Test.php +++ b/tests/Unit/File/ASN1Test.php @@ -18,7 +18,7 @@ class Unit_File_ASN1Test extends PhpseclibTestCase $KDC_REP = array( 'type' => FILE_ASN1_TYPE_SEQUENCE, 'children' => array( - 'pvno' => array( + 'pvno' => array( 'constant' => 0, 'optional' => true, 'explicit' => true,