PDA

View Full Version : 404.php phpBB threadid bug


Colin F
Tue 16th Oct '07, 6:26am
$action = 'thread';
if( preg_match("/&/", $_SERVER['REQUEST_URI']) )
{
$old_id = intval(substr(substr($_SERVER['REQUEST_URI'], 2), 0, strpos(substr($_SERVER['REQUEST_URI'], 2), '&')));
$sql = "SELECT threadid FROM {$tableprefix}thread WHERE importthreadid={$old_id}";
}This code (from line 135, /tools/404.php) to fetch the $old_id doesn't work, as the REQUEST_URI includes the filename.

Thus if this were the URL:
http://www.foo.com/forums/viewtopic.php?t=4371&postdays=0&postorder=asc&start=0

it would return:
iewtopic.php?t=4371

This in turn would be intval()'d to 0.


I'd guess the same thing happens for post links.

Jerry
Wed 14th Nov '07, 4:22pm
I'm thinking moving this to vb.org as it's not going to be supported officially as ImpEx is, it was released as an example for others to work on.