Skip to content

Commit ef9b987

Browse files
committed
added support for MongoBinData fields
1 parent 456d2cd commit ef9b987

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mongodbadmin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ function prepareValueForMongoDB($value)
103103
$value = preg_replace('/\'_id\' => \s*MongoId::__set_state\(array\(\s*\)\)/', '\'_id\' => new MongoId("' . (isset($_REQUEST['id']) ? $_REQUEST['id'] : '') . '")', $value);
104104
$value = preg_replace('/MongoId::__set_state\(array\(\s*\)\)/', 'new MongoId()', $value);
105105
$value = preg_replace('/MongoDate::__set_state\(array\(\s*\'sec\' => (\d+),\s*\'usec\' => \d+,\s*\)\)/m', 'new MongoDate($1)', $value);
106+
$value = preg_replace('/MongoBinData::__set_state\(array\(\s*\'bin\' => \'(.*?)\',\s*\'type\' => ([1,2,3,5,128]),\s*\)\)/m', 'new MongoBinData(\'$1\', $2)', $value);
106107

107108
eval('$value = ' . $value . ';');
108109

0 commit comments

Comments
 (0)