2023-06-17, 06:37 AM
(This post was last modified: 2023-06-17, 06:41 AM by Laird. Edited 2 times in total.)
(2023-06-17, 02:36 AM)PARADOX987 Wrote: for me it works well and the code gave by Laird is working fine
Unfortunately, though, it was buggy, but often enough just "happened to work". Here's code which hopefully this time is working:
(2023-06-15, 08:52 PM)jkcool Wrote: Only Theme Selector index issue is remaining.
Try replacing line 5465 of
inc/functions.php
: if(!empty($_SERVER['SCRIPT_NAME']))
with: $location = false;
if(!empty($_SERVER['REQUEST_URI']))
{
$https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
$scheme = $https ? 'https://' : 'http://';
$script_loc = $scheme.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$a = explode($mybb->settings['bburl'], $script_loc);
if(count($a) == 2 && $a[0] == '')
{
if($a[1] == '/' || $a[1] == '/index.php')
{
// The + 1 is so we leave the trailing slash in case it's the only
// character left after removing 'index.php' - otherwise, in that
// scenario, we'd be left with an empty location, which would default
// to reloading the current URL, which would use 'index.php'.
$location = htmlspecialchars_uni(substr($_SERVER['REQUEST_URI'], 0, strlen($_SERVER['REQUEST_URI']) - strlen($a[1]) + 1));
}
}
}
if($location !== false)
{
// Do nothing - $location was already set above.
}
elseif(!empty($_SERVER['SCRIPT_NAME']))