From aa45d84855593c42d7f6807a99c22492d39beb97 Mon Sep 17 00:00:00 2001 From: bachy Date: Sat, 8 Dec 2012 11:39:10 +0100 Subject: [PATCH] repatch inc/entity.inc http://drupal.org/node/1003788#comment-5195682 Signed-off-by: bachy --- includes/entity.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/entity.inc b/includes/entity.inc index 2fefd590..4f0c6c1d 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -160,6 +160,18 @@ 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])) {