Obfuscated bugfix

This commit is contained in:
Daniil Gentili 2019-06-28 19:37:23 +02:00 committed by GitHub
parent 5af3fe77c6
commit 49903b215e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,12 +186,15 @@ class ObfuscatedStream implements BufferedProxyStreamInterface
*/ */
public function setExtra($extra) public function setExtra($extra)
{ {
if (isset($extra['secret']) && strlen($extra['secret']) > 17) { if (isset($extra['secret'])) {
if (strlen($extra['secret']) > 17) {
$extra['secret'] = hex2bin($extra['secret']); $extra['secret'] = hex2bin($extra['secret']);
} }
if (isset($extra['secret']) && strlen($extra['secret']) == 17) { if (strlen($extra['secret']) == 17) {
$extra['secret'] = substr($extra['secret'], 0, 16); $extra['secret'] = substr($extra['secret'], 1, 16);
} }
}
$this->extra = $extra; $this->extra = $extra;
} }