Code Duplication    Length = 5-5 lines in 2 locations

model/connect/MySQLDatabase.php 2 locations

@@ 289-293 (lines=5) @@
286
				user_error('formattedDatetimeClause(): unsupported format character %' . $match, E_USER_WARNING);
287
			}
288
289
		if (preg_match('/^now$/i', $date)) {
290
			$date = "NOW()";
291
		} else if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/i', $date)) {
292
			$date = "'$date'";
293
		}
294
295
		if ($format == '%U') return "UNIX_TIMESTAMP($date)";
296
@@ 303-307 (lines=5) @@
300
	public function datetimeIntervalClause($date, $interval) {
301
		$interval = preg_replace('/(year|month|day|hour|minute|second)s/i', '$1', $interval);
302
303
		if (preg_match('/^now$/i', $date)) {
304
			$date = "NOW()";
305
		} else if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/i', $date)) {
306
			$date = "'$date'";
307
		}
308
309
		return "$date + INTERVAL $interval";
310
	}