$revision_id = absint( $to );
$redirect = 'edit.php';
-switch ( $action ) :
+switch ( $action ) {
case 'restore' :
if ( ! $revision = wp_get_post_revision( $revision_id ) )
break;
$redirect = false;
break;
-endswitch;
+}
// Empty post_type means either malformed object found, or no valid parent was found.
if ( ! $redirect && empty( $post->post_type ) )