| @@ 381-403 (lines=23) @@ | ||
| 378 | } |
|
| 379 | ||
| 380 | // Debugging. |
|
| 381 | if (isset($db_show_debug) && $db_show_debug === true) |
|
| 382 | { |
|
| 383 | // Get the file and line number this function was called. |
|
| 384 | list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__); |
|
| 385 | ||
| 386 | // Initialize $db_cache if not already initialized. |
|
| 387 | if (!isset($db_cache)) |
|
| 388 | $db_cache = array(); |
|
| 389 | ||
| 390 | if (!empty($_SESSION['debug_redirect'])) |
|
| 391 | { |
|
| 392 | $db_cache = array_merge($_SESSION['debug_redirect'], $db_cache); |
|
| 393 | $db_count = count($db_cache) + 1; |
|
| 394 | $_SESSION['debug_redirect'] = array(); |
|
| 395 | } |
|
| 396 | ||
| 397 | $st = microtime(); |
|
| 398 | // Don't overload it. |
|
| 399 | $db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...'; |
|
| 400 | $db_cache[$db_count]['f'] = $file; |
|
| 401 | $db_cache[$db_count]['l'] = $line; |
|
| 402 | $db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start)); |
|
| 403 | } |
|
| 404 | ||
| 405 | // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. |
|
| 406 | if (empty($modSettings['disableQueryCheck'])) |
|
| @@ 423-445 (lines=23) @@ | ||
| 420 | } |
|
| 421 | ||
| 422 | // Debugging. |
|
| 423 | if (isset($db_show_debug) && $db_show_debug === true) |
|
| 424 | { |
|
| 425 | // Get the file and line number this function was called. |
|
| 426 | list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__); |
|
| 427 | ||
| 428 | // Initialize $db_cache if not already initialized. |
|
| 429 | if (!isset($db_cache)) |
|
| 430 | $db_cache = array(); |
|
| 431 | ||
| 432 | if (!empty($_SESSION['debug_redirect'])) |
|
| 433 | { |
|
| 434 | $db_cache = array_merge($_SESSION['debug_redirect'], $db_cache); |
|
| 435 | $db_count = count($db_cache) + 1; |
|
| 436 | $_SESSION['debug_redirect'] = array(); |
|
| 437 | } |
|
| 438 | ||
| 439 | // Don't overload it. |
|
| 440 | $st = microtime(); |
|
| 441 | $db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...'; |
|
| 442 | $db_cache[$db_count]['f'] = $file; |
|
| 443 | $db_cache[$db_count]['l'] = $line; |
|
| 444 | $db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start)); |
|
| 445 | } |
|
| 446 | ||
| 447 | // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. |
|
| 448 | if (empty($modSettings['disableQueryCheck'])) |
|