Code Duplication    Length = 9-9 lines in 6 locations

modules/sitemaps/sitemaps.php 6 locations

@@ 226-234 (lines=9) @@
223
			}
224
225
			// Catch sitemap xml.
226
			if ( preg_match( $regex['sitemap'], $request['sitemap_name'] ) ) {
227
				$this->serve_raw_and_die(
228
					$xml_content_type,
229
					$this->librarian->get_sitemap_text(
230
						$request['sitemap_name'],
231
						JP_PAGE_SITEMAP_TYPE
232
					)
233
				);
234
			}
235
236
			// Catch sitemap index xml.
237
			if ( preg_match( $regex['index'], $request['sitemap_name'] ) ) {
@@ 237-245 (lines=9) @@
234
			}
235
236
			// Catch sitemap index xml.
237
			if ( preg_match( $regex['index'], $request['sitemap_name'] ) ) {
238
				$this->serve_raw_and_die(
239
					$xml_content_type,
240
					$this->librarian->get_sitemap_text(
241
						$request['sitemap_name'],
242
						JP_PAGE_SITEMAP_INDEX_TYPE
243
					)
244
				);
245
			}
246
247
			// Catch sitemap xsl.
248
			if ( preg_match( $regex['sitemap-style'], $request['sitemap_name'] ) ) {
@@ 264-272 (lines=9) @@
261
			}
262
263
			// Catch image sitemap xml.
264
			if ( preg_match( $regex['image'], $request['sitemap_name'] ) ) {
265
				$this->serve_raw_and_die(
266
					$xml_content_type,
267
					$this->librarian->get_sitemap_text(
268
						$request['sitemap_name'],
269
						JP_IMAGE_SITEMAP_TYPE
270
					)
271
				);
272
			}
273
274
			// Catch image sitemap index xml.
275
			if ( preg_match( $regex['image-index'], $request['sitemap_name'] ) ) {
@@ 275-283 (lines=9) @@
272
			}
273
274
			// Catch image sitemap index xml.
275
			if ( preg_match( $regex['image-index'], $request['sitemap_name'] ) ) {
276
				$this->serve_raw_and_die(
277
					$xml_content_type,
278
					$this->librarian->get_sitemap_text(
279
						$request['sitemap_name'],
280
						JP_IMAGE_SITEMAP_INDEX_TYPE
281
					)
282
				);
283
			}
284
285
			// Catch image sitemap xsl.
286
			if ( preg_match( $regex['image-style'], $request['sitemap_name'] ) ) {
@@ 294-302 (lines=9) @@
291
			}
292
293
			// Catch video sitemap xml.
294
			if ( preg_match( $regex['video'], $request['sitemap_name'] ) ) {
295
				$this->serve_raw_and_die(
296
					$xml_content_type,
297
					$this->librarian->get_sitemap_text(
298
						$request['sitemap_name'],
299
						JP_VIDEO_SITEMAP_TYPE
300
					)
301
				);
302
			}
303
304
			// Catch video sitemap index xml.
305
			if ( preg_match( $regex['video-index'], $request['sitemap_name'] ) ) {
@@ 305-313 (lines=9) @@
302
			}
303
304
			// Catch video sitemap index xml.
305
			if ( preg_match( $regex['video-index'], $request['sitemap_name'] ) ) {
306
				$this->serve_raw_and_die(
307
					$xml_content_type,
308
					$this->librarian->get_sitemap_text(
309
						$request['sitemap_name'],
310
						JP_VIDEO_SITEMAP_INDEX_TYPE
311
					)
312
				);
313
			}
314
315
			// Catch video sitemap xsl.
316
			if ( preg_match( $regex['video-style'], $request['sitemap_name'] ) ) {