Code Duplication    Length = 12-12 lines in 2 locations

src/wp-admin/upload.php 2 locations

@@ 144-155 (lines=12) @@
141
			}
142
			$location = add_query_arg( array( 'trashed' => count( $post_ids ), 'ids' => join( ',', $post_ids ) ), $location );
143
			break;
144
		case 'untrash':
145
			if ( !isset( $post_ids ) )
146
				break;
147
			foreach ( (array) $post_ids as $post_id ) {
148
				if ( !current_user_can( 'delete_post', $post_id ) )
149
					wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
150
151
				if ( !wp_untrash_post( $post_id ) )
152
					wp_die( __( 'Error in restoring from Trash.' ) );
153
			}
154
			$location = add_query_arg( 'untrashed', count( $post_ids ), $location );
155
			break;
156
		case 'delete':
157
			if ( !isset( $post_ids ) )
158
				break;
@@ 156-167 (lines=12) @@
153
			}
154
			$location = add_query_arg( 'untrashed', count( $post_ids ), $location );
155
			break;
156
		case 'delete':
157
			if ( !isset( $post_ids ) )
158
				break;
159
			foreach ( (array) $post_ids as $post_id_del ) {
160
				if ( !current_user_can( 'delete_post', $post_id_del ) )
161
					wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
162
163
				if ( !wp_delete_attachment( $post_id_del ) )
164
					wp_die( __( 'Error in deleting.' ) );
165
			}
166
			$location = add_query_arg( 'deleted', count( $post_ids ), $location );
167
			break;
168
		default:
169
			/** This action is documented in wp-admin/edit-comments.php */
170
			$location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $doaction, $post_ids );