| @@ 397-419 (lines=23) @@ | ||
| 394 | } |
|
| 395 | ||
| 396 | // Debugging. |
|
| 397 | if (isset($db_show_debug) && $db_show_debug === true) |
|
| 398 | { |
|
| 399 | // Get the file and line number this function was called. |
|
| 400 | list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__); |
|
| 401 | ||
| 402 | // Initialize $db_cache if not already initialized. |
|
| 403 | if (!isset($db_cache)) |
|
| 404 | $db_cache = array(); |
|
| 405 | ||
| 406 | if (!empty($_SESSION['debug_redirect'])) |
|
| 407 | { |
|
| 408 | $db_cache = array_merge($_SESSION['debug_redirect'], $db_cache); |
|
| 409 | $db_count = count($db_cache) + 1; |
|
| 410 | $_SESSION['debug_redirect'] = array(); |
|
| 411 | } |
|
| 412 | ||
| 413 | $st = microtime(); |
|
| 414 | // Don't overload it. |
|
| 415 | $db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...'; |
|
| 416 | $db_cache[$db_count]['f'] = $file; |
|
| 417 | $db_cache[$db_count]['l'] = $line; |
|
| 418 | $db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start)); |
|
| 419 | } |
|
| 420 | ||
| 421 | // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. |
|
| 422 | if (empty($modSettings['disableQueryCheck'])) |
|
| @@ 430-452 (lines=23) @@ | ||
| 427 | } |
|
| 428 | ||
| 429 | // Debugging. |
|
| 430 | if (isset($db_show_debug) && $db_show_debug === true) |
|
| 431 | { |
|
| 432 | // Get the file and line number this function was called. |
|
| 433 | list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__); |
|
| 434 | ||
| 435 | // Initialize $db_cache if not already initialized. |
|
| 436 | if (!isset($db_cache)) |
|
| 437 | $db_cache = array(); |
|
| 438 | ||
| 439 | if (!empty($_SESSION['debug_redirect'])) |
|
| 440 | { |
|
| 441 | $db_cache = array_merge($_SESSION['debug_redirect'], $db_cache); |
|
| 442 | $db_count = count($db_cache) + 1; |
|
| 443 | $_SESSION['debug_redirect'] = array(); |
|
| 444 | } |
|
| 445 | ||
| 446 | // Don't overload it. |
|
| 447 | $st = microtime(); |
|
| 448 | $db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...'; |
|
| 449 | $db_cache[$db_count]['f'] = $file; |
|
| 450 | $db_cache[$db_count]['l'] = $line; |
|
| 451 | $db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start)); |
|
| 452 | } |
|
| 453 | ||
| 454 | // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. |
|
| 455 | if (empty($modSettings['disableQueryCheck'])) |
|