Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 31856)
+++ src/wp-includes/query.php	(working copy)
@@ -4308,7 +4308,7 @@
 		// most likely case
 		if ( 'posts' == get_option( 'show_on_front') && $this->is_home() )
 			return true;
-		elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page( get_option( 'page_on_front' ) ) )
+		elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page() && $this->get_queried_object_id() == get_option( 'page_on_front' ) )
 			return true;
 		else
 			return false;
Index: tests/phpunit/tests/query/conditionals.php
===================================================================
--- tests/phpunit/tests/query/conditionals.php	(revision 31856)
+++ tests/phpunit/tests/query/conditionals.php	(working copy)
@@ -988,4 +988,21 @@
 		$this->assertFalse( is_page_template( array( 'test.php' ) ) );
 		$this->assertTrue( is_page_template( array('test.php', 'example.php') ) );
 	}
+
+	/**
+	 * @ticket 31711
+	 */
+	function test_is_front_page_id_equals_the_title_of_other_page() {
+		$post_1 = $this->factory->post->create( array( 'post_type' => 'page' ) );
+		$post_2 = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => $post_1 ) );
+
+		update_option('show_on_front', 'page');
+		update_option('page_on_front', $post_1);
+
+		$this->go_to( "/?page_id=$post_1" );
+		$this->assertTrue( is_front_page() );
+
+		$this->go_to( "/?page_id=$post_2" );
+		$this->assertFalse( is_front_page() );
+	}
 }
