From d9d092295be490e6fed528fd549d8be26375d4ab Mon Sep 17 00:00:00 2001 From: bachy Date: Wed, 6 Mar 2013 14:58:30 +0100 Subject: [PATCH] rematch includes/entity.inc Signed-off-by: bachy --- includes/entity.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/entity.inc b/includes/entity.inc index 2fefd590..7fa0caa6 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -159,7 +159,19 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface { */ public function load($ids = array(), $conditions = array()) { $entities = array(); - + + # PATCH http://drupal.org/node/1003788#comment-5195682 + // Clean the $ids array to remove non-integer values that can be passed + // in from various sources, including menu callbacks. + if (is_array($ids)) { + foreach ($ids as $key => $id) { + if (empty($id) || ((string) $id !== (string) (int) $id)) { + unset($ids[$key]); + } + } + } + # endpatch + // Revisions are not statically cached, and require a different query to // other conditions, so separate the revision id into its own variable. if ($this->revisionKey && isset($conditions[$this->revisionKey])) {