@@ -191,12 +191,15 @@ discard block |
||
191 | 191 | $tasksdir = $sourcedir . '/tasks'; |
192 | 192 | |
193 | 193 | # Make sure the paths are correct... at least try to fix them. |
194 | -if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt')) |
|
194 | +if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt')) { |
|
195 | 195 | $boarddir = dirname(__FILE__); |
196 | -if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources')) |
|
196 | +} |
|
197 | +if (!file_exists($sourcedir) && file_exists($boarddir . '/Sources')) { |
|
197 | 198 | $sourcedir = $boarddir . '/Sources'; |
198 | -if (!file_exists($cachedir) && file_exists($boarddir . '/cache')) |
|
199 | +} |
|
200 | +if (!file_exists($cachedir) && file_exists($boarddir . '/cache')) { |
|
199 | 201 | $cachedir = $boarddir . '/cache'; |
202 | +} |
|
200 | 203 | |
201 | 204 | ######### Legacy Settings ######### |
202 | 205 | # UTF-8 is now the only character set supported in 2.1. |
@@ -204,8 +207,9 @@ discard block |
||
204 | 207 | |
205 | 208 | ########## Error-Catching ########## |
206 | 209 | # Note: You shouldn't touch these settings. |
207 | -if (file_exists((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php')) |
|
210 | +if (file_exists((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php')) { |
|
208 | 211 | include((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php'); |
212 | +} |
|
209 | 213 | |
210 | 214 | if (!isset($db_last_error)) |
211 | 215 | { |
@@ -217,10 +221,11 @@ discard block |
||
217 | 221 | if (file_exists(dirname(__FILE__) . '/install.php')) |
218 | 222 | { |
219 | 223 | $secure = false; |
220 | - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') |
|
221 | - $secure = true; |
|
222 | - elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') |
|
223 | - $secure = true; |
|
224 | + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { |
|
225 | + $secure = true; |
|
226 | + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') { |
|
227 | + $secure = true; |
|
228 | + } |
|
224 | 229 | |
225 | 230 | header('location: http' . ($secure ? 's' : '') . '://' . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST']) . (strtr(dirname($_SERVER['PHP_SELF']), '\\', '/') == '/' ? '' : strtr(dirname($_SERVER['PHP_SELF']), '\\', '/')) . '/install.php'); exit; |
226 | 231 | } |