1
0
Fork 0

Handle OpenSSL version after 26 patch releases

e.g. https://github.com/openssl/openssl/blob/OpenSSL_0_9_8zh/crypto/opensslv.h#L33
pull/4875/head
Chris Smith 2016-02-04 00:01:42 +00:00
parent 7117a5775f
commit e9e2514b5e
1 changed files with 12 additions and 2 deletions

View File

@ -146,8 +146,18 @@ class PlatformRepository extends ArrayRepository
break; break;
case 'openssl': case 'openssl':
$prettyVersion = preg_replace_callback('{^(?:OpenSSL\s*)?([0-9.]+)([a-z]?).*}', function ($match) { $prettyVersion = preg_replace_callback('{^(?:OpenSSL\s*)?([0-9.]+)([a-z]+).*}', function ($match) {
return $match[1] . (empty($match[2]) ? '' : '.'.(ord($match[2]) - 96)); if (empty($match[2])) {
return $match[1];
}
// OpenSSL versions add another letter when they reach Z.
// e.g. OpenSSL 0.9.8zh 3 Dec 2015
$patchVersion = array_sum(array_map(function ($letter) {
return ord($letter) - 96;
}, str_split($match[2])));
return $match[1].'.'.$patchVersion;
}, OPENSSL_VERSION_TEXT); }, OPENSSL_VERSION_TEXT);
break; break;