소스 검색

repatch inc/entity.inc

http://drupal.org/node/1003788#comment-5195682
Signed-off-by: bachy <git@g-u-i.net>
bachy 11 년 전
부모
커밋
1b6b74ea40
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      includes/entity.inc

+ 12 - 0
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])) {