Code Duplication    Length = 9-9 lines in 6 locations

modules/sitemaps/sitemaps.php 6 locations

@@ 216-224 (lines=9) @@
213
			}
214
215
			// Catch sitemap xml.
216
			if ( preg_match( $regex['sitemap'], $request['sitemap_name'] ) ) {
217
				$this->serve_raw_and_die(
218
					$xml_content_type,
219
					$this->librarian->get_sitemap_text(
220
						$request['sitemap_name'],
221
						JP_PAGE_SITEMAP_TYPE
222
					)
223
				);
224
			}
225
226
			// Catch sitemap index xml.
227
			if ( preg_match( $regex['index'], $request['sitemap_name'] ) ) {
@@ 227-235 (lines=9) @@
224
			}
225
226
			// Catch sitemap index xml.
227
			if ( preg_match( $regex['index'], $request['sitemap_name'] ) ) {
228
				$this->serve_raw_and_die(
229
					$xml_content_type,
230
					$this->librarian->get_sitemap_text(
231
						$request['sitemap_name'],
232
						JP_PAGE_SITEMAP_INDEX_TYPE
233
					)
234
				);
235
			}
236
237
			// Catch sitemap xsl.
238
			if ( preg_match( $regex['sitemap-style'], $request['sitemap_name'] ) ) {
@@ 254-262 (lines=9) @@
251
			}
252
253
			// Catch image sitemap xml.
254
			if ( preg_match( $regex['image'], $request['sitemap_name'] ) ) {
255
				$this->serve_raw_and_die(
256
					$xml_content_type,
257
					$this->librarian->get_sitemap_text(
258
						$request['sitemap_name'],
259
						JP_IMAGE_SITEMAP_TYPE
260
					)
261
				);
262
			}
263
264
			// Catch image sitemap index xml.
265
			if ( preg_match( $regex['image-index'], $request['sitemap_name'] ) ) {
@@ 265-273 (lines=9) @@
262
			}
263
264
			// Catch image sitemap index xml.
265
			if ( preg_match( $regex['image-index'], $request['sitemap_name'] ) ) {
266
				$this->serve_raw_and_die(
267
					$xml_content_type,
268
					$this->librarian->get_sitemap_text(
269
						$request['sitemap_name'],
270
						JP_IMAGE_SITEMAP_INDEX_TYPE
271
					)
272
				);
273
			}
274
275
			// Catch image sitemap xsl.
276
			if ( preg_match( $regex['image-style'], $request['sitemap_name'] ) ) {
@@ 284-292 (lines=9) @@
281
			}
282
283
			// Catch video sitemap xml.
284
			if ( preg_match( $regex['video'], $request['sitemap_name'] ) ) {
285
				$this->serve_raw_and_die(
286
					$xml_content_type,
287
					$this->librarian->get_sitemap_text(
288
						$request['sitemap_name'],
289
						JP_VIDEO_SITEMAP_TYPE
290
					)
291
				);
292
			}
293
294
			// Catch video sitemap index xml.
295
			if ( preg_match( $regex['video-index'], $request['sitemap_name'] ) ) {
@@ 295-303 (lines=9) @@
292
			}
293
294
			// Catch video sitemap index xml.
295
			if ( preg_match( $regex['video-index'], $request['sitemap_name'] ) ) {
296
				$this->serve_raw_and_die(
297
					$xml_content_type,
298
					$this->librarian->get_sitemap_text(
299
						$request['sitemap_name'],
300
						JP_VIDEO_SITEMAP_INDEX_TYPE
301
					)
302
				);
303
			}
304
305
			// Catch video sitemap xsl.
306
			if ( preg_match( $regex['video-style'], $request['sitemap_name'] ) ) {