Update to SMF 1.0.7 - Installation Instructions for 1.0.6

Update to SMF 1.0.7
This patch file will update your forum to SMF 1.0.7.

File Edits ALT + Click to collapse all the operations

./Sources/QueryString.php

Find: Select
* Software Version: SMF 1.0 *
Replace With: Select
* Software Version: SMF 1.0.7 *
Find: Select
// We actually don't want slashes in $_GET... just entities - which serve the same purpose.
if (get_magic_quotes_gpc() != 0)
$_SERVER['REQUEST_URI'] = stripslashes($_SERVER['REQUEST_URI']);

// Remove the .html, assuming there is one.
Replace With: Select
// Remove the .html, assuming there is one.
Find: Select
// If magic_quotes_gpc isn't off, remove the slashes from the get variables. (they're gonna be html'd anyway.)
if (get_magic_quotes_gpc() != 0)
$_SERVER['QUERY_STRING'] = stripslashes($_SERVER['QUERY_STRING']);

// Replace ';' with '&' and '&something&' with '&something=&'. (this is done for compatibility...)
Replace With: Select
// Replace ';' with '&' and '&something&' with '&something=&'. (this is done for compatibility...)
Find: Select
$_SERVER = addslashes__recursive($_SERVER);

// FILES work like this: k -> name -> array. So be careful.
foreach ($_FILES as $k => $dummy)
$_FILES[$k]['name'] = addslashes__recursive($_FILES[$k]['name']);
}
Replace With: Select

// FILES work like this: k -> name -> array. So be careful.
foreach ($_FILES as $k => $dummy)
$_FILES[$k]['name'] = addslashes__recursive($_FILES[$k]['name']);
}

// Take care of the server variables.
$_SERVER = addslashes__recursive($_SERVER);
Find: Select
if (empty($_SERVER['HTTP_USER_AGENT']))
$_SERVER['HTTP_USER_AGENT'] = '';
Replace With: Select
$_SERVER['HTTP_USER_AGENT'] = isset($_SERVER['HTTP_USER_AGENT']) ? htmlspecialchars(stripslashes($_SERVER['HTTP_USER_AGENT']), ENT_QUOTES) : '';

// Some final checking.
if (preg_match('~^((([1]?\d)?\d|2[0-4]\d|25[0-5])\.){3}(([1]?\d)?\d|2[0-4]\d|25[0-5])$~', $_SERVER['REMOTE_ADDR']) === 0)
$_SERVER['REMOTE_ADDR'] = '';

./changelog.txt

Find: Select
SMF 1.0.6 15 January 2006
================================================================================
December 2005:
--------------------------------------------------------------------------------
Add Before: Select
SMF 1.0.7 29 March 2006
================================================================================
March 2005:
--------------------------------------------------------------------------------
! Added an extra check on the HTTP_X_FORWARDED_FOR input variable. (QueryString.php)
! Limit the number of words that can be searched for a little bit. (Search.php)
! Prevent users from voting more than once in a poll. (Poll.php)

./index.php

Find: Select
* Software Version: SMF 1.0.6 *
Replace With: Select
* Software Version: SMF 1.0.7 *
Find: Select
$forum_version = 'SMF 1.0.6';
Replace With: Select
$forum_version = 'SMF 1.0.7';

./Sources/Search.php

Find: Select
* Software Version: SMF 1.0.5 *
Replace With: Select
* Software Version: SMF 1.0.7 *
Find: Select
$searchArray = array_unique($searchArray);
Replace With: Select
$searchArray = array_slice(array_unique($searchArray), 0, 10);

./Sources/Poll.php

Find: Select
* Software Version: SMF 1.0.3 *
Replace With: Select
* Software Version: SMF 1.0.7 *
Find: Select
elseif (!empty($row['changeVote']) && empty($_POST['options']))
Replace With: Select
elseif (!empty($row['changeVote']))
Find: Select
// Redirect back to the topic so the user can vote again!
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
Replace With: Select
// Redirect back to the topic so the user can vote again!
if (empty($_POST['options']))
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
Advertisement: