Advertisement:
2by2host

Navigation

Contents of smf_1-0-6_to_1-0-7_patch.mod:

<edit file>
$sourcedir/QueryString.php
</edit file>

<search for>
* Software Version:           SMF 1.0                                         *
</search for>

<replace>
* Software Version:           SMF 1.0.7                                       *
</replace>

<search for>
		// 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.
</search for>

<replace>
		// Remove the .html, assuming there is one.
</replace>

<search for>
		// 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...)
</search for>

<replace>
		// Replace ';' with '&' and '&something&' with '&something=&'.  (this is done for compatibility...)
</replace>

<search for>
		$_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']);
	}
</search for>

<replace>

		// 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);
</replace>

<search for>
	if (empty($_SERVER['HTTP_USER_AGENT']))
		$_SERVER['HTTP_USER_AGENT'] = '';
</search for>

<replace>
	$_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'] = '';
</replace>

<edit file>
$boarddir/changelog.txt
</edit file>

<search for>
SMF 1.0.6                                                        15 January 2006
================================================================================
December 2005:
--------------------------------------------------------------------------------
</search for>

<add before>
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)


</add before>

<edit file>
$boarddir/index.php
</edit file>

<search for>
* Software Version:           SMF 1.0.6                                       *
</search for>

<replace>
* Software Version:           SMF 1.0.7                                       *
</replace>

<search for>
$forum_version = 'SMF 1.0.6';
</search for>

<replace>
$forum_version = 'SMF 1.0.7';
</replace>

<edit file>
$sourcedir/Search.php
</edit file>

<search for>
* Software Version:           SMF 1.0.5                                       *
</search for>

<replace>
* Software Version:           SMF 1.0.7                                       *
</replace>

<search for>
	$searchArray = array_unique($searchArray);
</search for>

<replace>
	$searchArray = array_slice(array_unique($searchArray), 0, 10);
</replace>

<edit file>
$sourcedir/Poll.php
</edit file>

<search for>
* Software Version:           SMF 1.0.3                                       *
</search for>

<replace>
* Software Version:           SMF 1.0.7                                       *
</replace>

<search for>
	elseif (!empty($row['changeVote']) && empty($_POST['options']))
</search for>

<replace>
	elseif (!empty($row['changeVote']))
</replace>

<search for>
		// Redirect back to the topic so the user can vote again!
		redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
</search for>

<replace>
		// Redirect back to the topic so the user can vote again!
		if (empty($_POST['options']))
			redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
</replace>