From 4e367c96310dc38f431e5773b3e16502f1037c54 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 20 Feb 2018 09:40:59 +0000 Subject: [PATCH] Fixes for phar archives --- phpseclib/Crypt/Common/AsymmetricKey.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpseclib/Crypt/Common/AsymmetricKey.php b/phpseclib/Crypt/Common/AsymmetricKey.php index 8bf4f8b7..569d2236 100644 --- a/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/phpseclib/Crypt/Common/AsymmetricKey.php @@ -261,7 +261,8 @@ abstract class AsymmetricKey { if (!isset(self::$plugins[static::ALGORITHM][$format])) { self::$plugins[static::ALGORITHM][$format] = []; - foreach (glob(__DIR__ . '/../' . static::ALGORITHM . '/' . $format . '/*.php') as $file) { + foreach (new \DirectoryIterator(__DIR__ . '/../' . static::ALGORITHM . '/' . $format . '/') as $file) { + if ($file->getExtension() !== 'php') continue; $name = pathinfo($file, PATHINFO_FILENAME); $type = 'phpseclib\Crypt\\' . static::ALGORITHM . '\\' . $format . '\\' . $name; self::$plugins[static::ALGORITHM][$format][strtolower($name)] = $type;