diff options
| -rw-r--r-- | inc/config.php | 5 | ||||
| -rw-r--r-- | inc/functions.php | 1 | ||||
| -rw-r--r-- | mod.php | 2 | ||||
| -rw-r--r-- | post.php | 4 | ||||
| -rw-r--r-- | res/index.php | 2 | ||||
| -rw-r--r-- | src/index.php | 2 | ||||
| -rw-r--r-- | thumb/index.php | 2 |
7 files changed, 12 insertions, 6 deletions
diff --git a/inc/config.php b/inc/config.php index 0ca457c4..164c1f1a 100644 --- a/inc/config.php +++ b/inc/config.php @@ -119,6 +119,11 @@ // Multi-board (%s is board abbreviation) define('BOARD_PATH', '%s/', true); + // The HTTP status code to use when redirecting. + // Should be 3xx (redirection). http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + // "302" is recommended. + define('REDIRECT_HTTP', 302, true); + /* Mod stuff */ diff --git a/inc/functions.php b/inc/functions.php index b20ed091..2349197c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -44,6 +44,7 @@ function openBoard($uri) { global $sql; + sql_open(); $boards_res = mysql_query(sprintf( "SELECT * FROM `boards` WHERE `uri` = '%s' LIMIT 1", mysql_real_escape_string($uri) @@ -29,7 +29,7 @@ setCookies(); // Redirect - header('Location: ?' . MOD_DEFAULT, true, 302); + header('Location: ?' . MOD_DEFAULT, true, REDIRECT_HTTP); // Close connection sql_close(); @@ -306,9 +306,9 @@ sql_close(); if(ALWAYS_NOKO || $noko) { - header('Location: ' . ROOT . $board['dir'] . DIR_RES . ($OP?$id:$post['thread']) . '.html' . (!$OP?'#'.$id:''), true, 302); + header('Location: ' . ROOT . $board['dir'] . DIR_RES . ($OP?$id:$post['thread']) . '.html' . (!$OP?'#'.$id:''), true, REDIRECT_HTTP); } else { - header('Location: ' . ROOT . $board['dir'] . FILE_INDEX, true, 302); + header('Location: ' . ROOT . $board['dir'] . FILE_INDEX, true, REDIRECT_HTTP); } exit; diff --git a/res/index.php b/res/index.php index c5619a58..1869b1dd 100644 --- a/res/index.php +++ b/res/index.php @@ -1,3 +1,3 @@ <?php
- header('Location: ../', true, 302);
+ header('Location: ../', true, REDIRECT_HTTP);
?>
\ No newline at end of file diff --git a/src/index.php b/src/index.php index c5619a58..1869b1dd 100644 --- a/src/index.php +++ b/src/index.php @@ -1,3 +1,3 @@ <?php
- header('Location: ../', true, 302);
+ header('Location: ../', true, REDIRECT_HTTP);
?>
\ No newline at end of file diff --git a/thumb/index.php b/thumb/index.php index c5619a58..1869b1dd 100644 --- a/thumb/index.php +++ b/thumb/index.php @@ -1,3 +1,3 @@ <?php
- header('Location: ../', true, 302);
+ header('Location: ../', true, REDIRECT_HTTP);
?>
\ No newline at end of file |
