diff --git a/modules/entity/entity.controller.inc b/modules/entity/entity.controller.inc
index 8a34207..b17e5a5 100644
--- a/modules/entity/entity.controller.inc
+++ b/modules/entity/entity.controller.inc
@@ -164,6 +164,16 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
   public function load($ids = array(), $conditions = array()) {
     $entities = array();
 
+    // 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]);
+        }
+      }
+    }
+
     // 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])) {
diff --git a/modules/system/system.test b/modules/system/system.test
index 1dd2349..9d433ce 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -953,6 +953,14 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
     );
     $node = $this->drupalCreateNode($edit);
 
+    // Check that appending text to the node id fails.
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertResponse(200);
+    $this->drupalGet('node/' . $node->nid . 'garbage');
+    $this->assertResponse(404);
+    $this->drupalGet('node/' . $node->nid . '.000');
+    $this->assertResponse(404);
+
     // Use a custom 404 page.
     $this->drupalPost('admin/config/system/site-information', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
 
