Merge branch 'master' into php5

* master:
  ASN1: let strings in as well
  ASN1: make File_ASN1 accept int primitives and not just Math_BigInteger objects when an integer is expected
This commit is contained in:
Andreas Fischer 2014-05-06 00:41:59 +02:00
commit 1821f6b28f

View File

@ -950,6 +950,9 @@ class File_ASN1
case FILE_ASN1_TYPE_INTEGER:
case FILE_ASN1_TYPE_ENUMERATED:
if (!isset($mapping['mapping'])) {
if (is_numeric($source)) {
$source = new Math_BigInteger($source);
}
$value = $source->toBytes(true);
} else {
$value = array_search($source, $mapping['mapping']);