| @@ 276-281 (lines=6) @@ | ||
| 273 | return $buffer; |
|
| 274 | ||
| 275 | // Do nothing if the session is cookied, or they are a crawler - guests are caught by redirectexit(). |
|
| 276 | if (empty($_COOKIE) && SID != '' && !isBrowser('possibly_robot')) |
|
| 277 | $buffer = preg_replace('/(?<!<link rel="canonical" href=)"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', '"' . $scripturl . '?' . SID . '&', $buffer); |
|
| 278 | ||
| 279 | // Debugging templates, are we? |
|
| 280 | elseif (isset($_GET['debug'])) |
|
| 281 | $buffer = preg_replace('/(?<!<link rel="canonical" href=)"' . preg_quote($scripturl, '/') . '\\??/', '"' . $scripturl . '?debug;', $buffer); |
|
| 282 | ||
| 283 | // This should work even in 4.2.x, just not CGI without cgi.fix_pathinfo. |
|
| 284 | if (!empty($modSettings['queryless_urls']) && detectServer()->supportRewrite()) |
|
| @@ 789-793 (lines=5) @@ | ||
| 786 | $setLocation = $scripturl . ($setLocation != '' ? '?' . $setLocation : ''); |
|
| 787 | ||
| 788 | // Put the session ID in. |
|
| 789 | if (empty($_COOKIE) && defined('SID') && SID != '') |
|
| 790 | $setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', $scripturl . '?' . SID . ';', $setLocation); |
|
| 791 | // Keep that debug in their for template debugging! |
|
| 792 | elseif (isset($_GET['debug'])) |
|
| 793 | $setLocation = preg_replace('/^' . preg_quote($scripturl, '/') . '\\??/', $scripturl . '?debug;', $setLocation); |
|
| 794 | ||
| 795 | if (!empty($modSettings['queryless_urls']) && detectServer()->supportRewrite()) |
|
| 796 | { |
|