Index: wp-admin/includes/ajax-actions.php
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 23885)
+++ wp-admin/includes/ajax-actions.php	(working copy)
@@ -2096,22 +2096,22 @@
 function wp_ajax_revisions_data() {
 	check_ajax_referer( 'revisions-ajax-nonce', 'nonce' );
 
-	$compare_to = isset( $_GET['compare_to'] ) ? absint( $_GET['compare_to'] ) : 0;
-	$show_autosaves = isset( $_GET['show_autosaves'] ) ? $_GET['show_autosaves'] : '';
-	$show_split_view = isset( $_GET['show_split_view'] ) ? $_GET['show_split_view'] : '';
-	$post_id = isset( $_GET['post_id'] ) ? absint( $_GET['post_id'] ) : '';
-	$right_handle_at = isset( $_GET['right_handle_at'] ) ? $_GET['right_handle_at'] : 0;
-	$left_handle_at = isset( $_GET['left_handle_at'] ) ? $_GET['left_handle_at'] : 0;
-	$single_revision_id = isset( $_GET['single_revision_id'] ) ? $_GET['single_revision_id'] : 0;
+	$compare_to = ! empty( $_GET['compare_to'] ) ? absint( $_GET['compare_to'] ) : 0;
+	$show_autosaves = ! empty( $_GET['show_autosaves'] );
+	$show_split_view = ! empty( $_GET['show_split_view'] );
+	$post_id = ! empty( $_GET['post_id'] ) ? absint( $_GET['post_id'] ) : 0;
+	$right_handle_at = ! empty( $_GET['right_handle_at'] ) ? (int) $_GET['right_handle_at'] : 0;
+	$left_handle_at = ! empty( $_GET['left_handle_at'] ) ? (int) $_GET['left_handle_at'] : 0;
+	$single_revision_id = ! empty( $_GET['single_revision_id'] ) ? absint( $_GET['single_revision_id'] ) : 0;
 
-	$compare_two_mode = ( '' == $post_id ) ? false : true;
+	$compare_two_mode = (bool) $post_id;
 	//
 	//TODO: currently code returns all possible comparisons for the indicated 'compare_to' revision
 	//however, the front end prevents users from pulling the right handle past the left or the left pass the right,
 	//so only the possible diffs need be generated
 	//
 	$alltherevisions = array();
-	if ( '' == $post_id )
+	if ( ! $post_id )
 		$post_id = $compare_to;
 
 	if ( ! current_user_can( 'read_post', $post_id ) )
@@ -2127,26 +2127,24 @@
 
 	//single model fetch mode
 	//return the diff of a single revision comparison
-	if ( 0 != $single_revision_id ) {
+	if ( $single_revision_id ) {
 		$right_revision = get_post( $single_revision_id );
 
-	if ( 0 == $compare_to )
+		if ( ! $compare_to )
 			$left_revision = get_post( $post_id );
 
-	// make sure the right revision is the most recent
-	if ( $compare_two_mode && $right_revision->ID < $left_revision->ID ) {
-		$temp = $left_revision;
-		$left_revision = $right_revision;
-		$right_revision = $temp;
-	}
+		// make sure the right revision is the most recent
+		if ( $compare_two_mode && $right_revision->ID < $left_revision->ID ) {
+			$temp = $left_revision;
+			$left_revision = $right_revision;
+			$right_revision = $temp;
+		}
 
-		$linesadded=0;
-		$linesdeleted=0;
-
+		$linesadded = $linesdeleted = 0;
+		$content = '';
 		//
 		//compare from left to right, passed from application
 		//
-		$content='';
 		foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
 			$left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' );
 			$right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' );
@@ -2155,7 +2153,7 @@
 
 			$args = array();
 
-			if ( ! empty( $show_split_view ) )
+			if ( $show_split_view )
 				 $args = array( 'show_split_view' => true );
 
 			// compare_to == 0 means first revision, so compare to a blank field to show whats changed
@@ -2169,9 +2167,8 @@
 
 			if ( isset( $diff[ 'linesdeleted' ] ) )
 				$linesdeleted = $linesdeleted + $diff[ 'linesdeleted' ];
+		}
 
-
-		}
 		$content = '' == $content ? __( 'No difference' ) : $content;
 
 		$alltherevisions = array (
@@ -2179,6 +2176,7 @@
 			'lines_deleted' => $linesdeleted,
 			'lines_added' => $linesadded
 		);
+
 		echo json_encode( $alltherevisions );
 		exit();
 	} //end single model fetch
@@ -2192,8 +2190,8 @@
 
 	foreach ( $revisions as $revision ) :
 		//error_log( ( $show_autosaves  ));
-		if ( empty( $show_autosaves ) && wp_is_post_autosave( $revision ) )
-				continue;
+		if ( $show_autosaves && wp_is_post_autosave( $revision ) )
+			continue;
 
 		$revision_from_date_author = '';
 		$count++;
@@ -2237,8 +2235,8 @@
 		$autosavef = __( '%1$s [Autosave]' );
 		$currentf  = __( '%1$s [Current Revision]' );
 
-		if ( ! $post = get_post( $post_id))
-			exit();
+		if ( ! $post = get_post( $post_id ) )
+			exit(); // Should that be `continue;` instead?
 
 		if ( $left_revision->post_modified === $post->post_modified )
 			$revision_from_date_author = sprintf( $currentf, $revision_from_date_author );
