Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

For SonataDoctrineMongoDb, a MongoId is not numeric but hexadecimal. …

…The test is_numeric() fails in method Admin::getSubject()


Replaced by a preg_match. Could use ctype_xdigit too (matter of taste)
  • Loading branch information...
commit 5c33226d1fbe62fd90af92393a30c4aab5b4034b 1 parent 06825c9
Florent Genette authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  Admin/Admin.php
View
2  Admin/Admin.php
@@ -1342,7 +1342,7 @@ public function getSubject()
{
if ($this->subject === null && $this->request) {
$id = $this->request->get($this->getIdParameter());
- if (!is_numeric($id)) {
+ if (!preg_match('#^[0-9A-Fa-f]+$#', $id)) {
$this->subject = false;
} else {
$this->subject = $this->getModelManager()->find($this->getClass(), $id);
Please sign in to comment.
Something went wrong with that request. Please try again.