Code Duplication    Length = 23-23 lines in 2 locations

Sources/Subs-Db-postgresql.php 1 location

@@ 390-412 (lines=23) @@
387
	}
388
389
	// Debugging.
390
	if (isset($db_show_debug) && $db_show_debug === true)
391
	{
392
		// Get the file and line number this function was called.
393
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
394
395
		// Initialize $db_cache if not already initialized.
396
		if (!isset($db_cache))
397
			$db_cache = array();
398
399
		if (!empty($_SESSION['debug_redirect']))
400
		{
401
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
402
			$db_count = count($db_cache) + 1;
403
			$_SESSION['debug_redirect'] = array();
404
		}
405
406
		$st = microtime();
407
		// Don't overload it.
408
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
409
		$db_cache[$db_count]['f'] = $file;
410
		$db_cache[$db_count]['l'] = $line;
411
		$db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start));
412
	}
413
414
	// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
415
	if (empty($modSettings['disableQueryCheck']))

Sources/Subs-Db-mysql.php 1 location

@@ 435-457 (lines=23) @@
432
	}
433
434
	// Debugging.
435
	if (isset($db_show_debug) && $db_show_debug === true)
436
	{
437
		// Get the file and line number this function was called.
438
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
439
440
		// Initialize $db_cache if not already initialized.
441
		if (!isset($db_cache))
442
			$db_cache = array();
443
444
		if (!empty($_SESSION['debug_redirect']))
445
		{
446
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
447
			$db_count = count($db_cache) + 1;
448
			$_SESSION['debug_redirect'] = array();
449
		}
450
451
		// Don't overload it.
452
		$st = microtime();
453
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
454
		$db_cache[$db_count]['f'] = $file;
455
		$db_cache[$db_count]['l'] = $line;
456
		$db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start));
457
	}
458
459
	// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
460
	if (empty($modSettings['disableQueryCheck']))