Code Duplication    Length = 4-9 lines in 2 locations

controller/admin_controller.php 2 locations

@@ 392-400 (lines=9) @@
389
		}
390
391
		// Validate ad end date pattern
392
		if (!preg_match('#(^\d{4}\-\d{2}\-\d{2}$)?#', $data['ad_end_date']))
393
		{
394
			$this->errors[] = $this->user->lang('AD_END_DATE_INVALID');
395
396
			// Return immediately to retain end date text.
397
			// Admin might just accidentally remove one number, so we
398
			// don't want to remove it all.
399
			return $data;
400
		}
401
402
		// Convert ad end date to unix timestamp
403
		$data['ad_end_date'] = (int) $this->user->get_timestamp_from_format(self::DATE_FORMAT, $data['ad_end_date']);
@@ 405-408 (lines=4) @@
402
		// Convert ad end date to unix timestamp
403
		$data['ad_end_date'] = (int) $this->user->get_timestamp_from_format(self::DATE_FORMAT, $data['ad_end_date']);
404
		// Validate ad end date for already expired date
405
		if ($data['ad_end_date'] != 0 && $data['ad_end_date'] < time())
406
		{
407
			$this->errors[] = $this->user->lang('AD_END_DATE_INVALID');
408
		}
409
410
		return $data;
411
	}