1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-12-03 10:07:47 +01:00

Correct the remaining case by using instanceof.

This commit is contained in:
Andreas Fischer 2014-06-02 20:24:25 +02:00
parent f2f5fcd70a
commit a643e5bfb5

View File

@ -1030,7 +1030,7 @@ class File_ASN1
case !isset($source):
return $this->_encode_der(null, array('type' => FILE_ASN1_TYPE_NULL) + $mapping, null, $special);
case is_int($source):
case is_object($source) && strtolower(get_class($source)) == 'math_biginteger': // TODO
case $source instanceof \phpseclib\Math\BigInteger:
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_INTEGER) + $mapping, null, $special);
case is_float($source):
return $this->_encode_der($source, array('type' => FILE_ASN1_TYPE_REAL) + $mapping, null, $special);