Advertisement:
NameCheap

Navigation

Contents of smf_1-1-5_can_fail.xml:

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
	<id>smf:smf-1.0.13-1.1.5-2.0.b3.1</id>
	<version>1.0</version>

	<file name="$boarddir/SSI.php" error="skip">
		<operation>
			<search position="replace"><![CDATA[
* Software Version:           SMF 1.1                                             *
]]></search>
			<add><![CDATA[
* Software Version:           SMF 1.1.5                                           *
]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[
$ssi_magic_quotes_runtime = get_magic_quotes_runtime();
]]></search>
			<add><![CDATA[
$ssi_magic_quotes_runtime = @get_magic_quotes_runtime();
]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[
// Get the forum's settings for database and file paths.
]]></search>
			<add><![CDATA[
// Make sure some things simply do not exist.
foreach (array('db_character_set') as $variable)
	if (isset($GLOBALS[$variable]))
		unset($GLOBALS[$variable]);

// Get the forum's settings for database and file paths.
]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[
	if ((get_magic_quotes_gpc() ? addslashes($_REQUEST['ssi_layers']) : $_REQUEST['ssi_layers']) == htmlspecialchars($ssi_layers))
]]></search>
			<add><![CDATA[
	if ((@get_magic_quotes_gpc() ? addslashes($_REQUEST['ssi_layers']) : $_REQUEST['ssi_layers']) == htmlspecialchars($ssi_layers))
]]></add>
		</operation>

		<!--
			One of next two operations should be done, depending on the version.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
			p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes
		FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
]]></search>
			<add><![CDATA[
			p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, b.ID_BOARD
		FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
			p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, p.ID_BOARD
		FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
]]></search>
			<add><![CDATA[
			p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, b.ID_BOARD
		FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
]]></add>
		</operation>

		<operation>
			<search position="replace"><![CDATA[
	elseif ($user_info['is_guest'] || !empty($row['votingLocked']) || !allowedTo('poll_vote'))
]]></search>
			<add><![CDATA[
	elseif ($user_info['is_guest'] || !empty($row['votingLocked']) || !allowedTo('poll_vote', array($row['ID_BOARD'])))
]]></add>
		</operation>
	</file>


	<file name="$languagedir/index.english.php" error="skip">
		<operation>
			<search position="replace"><![CDATA[
// Version: 1.1.2; index
]]></search>
			<add><![CDATA[
// Version: 1.1.5; index
]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[
$forum_copyright = '<a href="http://www.simplemachines.org/" title="Simple Machines Forum" target="_blank">Powered by ' . $forum_version . '</a> | 
<a href="http://www.simplemachines.org/about/copyright.php" title="Free Forum Software" target="_blank">SMF &copy; 2006-2007, Simple Machines LLC</a>';
]]></search>
			<add><![CDATA[
$forum_copyright = '<a href="http://www.simplemachines.org/" title="Simple Machines Forum" target="_blank">Powered by ' . $forum_version . '</a> | 
<a href="http://www.simplemachines.org/about/copyright.php" title="Free Forum Software" target="_blank">SMF &copy; 2006-2008, Simple Machines LLC</a>';
]]></add>
		</operation>
	</file>


	<file name="$languagedir/ModSettings.english.php" error="skip">
		<operation>
			<search position="replace"><![CDATA[
// Version: 1.1; ModSettings
]]></search>
			<add><![CDATA[
// Version: 1.1.5; ModSettings
]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[
$txt['detected_Zend'] = '<b style="color: green">SMF has detected that your server has Zend installed.';

$txt['cache_enable'] = 'Caching Level';
]]></search>
			<add><![CDATA[
$txt['detected_Zend'] = '<b style="color: green">SMF has detected that your server has Zend installed.';
$txt['detected_Memcached'] = '<b style="color: green">SMF has detected that your server has Memcached installed.';

$txt['cache_enable'] = 'Caching Level';
]]></add>
		</operation>
	</file>


	<file name="$sourcedir/QueryString.php">
		<!--
			The following operation might have already been done.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
		$var[stripslashes($k)] = $level > 25 ? null : stripslashes__recursive($v, $level + 1);

	return $var;
]]></search>
			<add><![CDATA[
		$new_var[stripslashes($k)] = $level > 25 ? null : stripslashes__recursive($v, $level + 1);

	return $new_var;
]]></add>
		</operation>
		<!--
			There are two versions of htmltrim__recursive around. This
			modification should replace either version into what it should be.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
	if (!is_array($var))
		return isset($func) ? $func['htmltrim']($var) : trim($var, " \t\n\r\x0B\0\xA0");

	// Go through all the elements and remove the whitespace.
	foreach ($var as $k => $v)
		$new_var[$k] = $level > 25 ? null : htmltrim__recursive($v, $level + 1);

	return $new_var;
]]></search>
			<add><![CDATA[
	if (!is_array($var))
		return isset($func) ? $func['htmltrim']($var) : trim($var, " \t\n\r\x0B\0\xA0");

	$new_var = array();

	// Go through all the elements and remove the whitespace.
	foreach ($var as $k => $v)
		$new_var[$k] = $level > 25 ? null : htmltrim__recursive($v, $level + 1);

	return $new_var;
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
	if (!is_array($var))
		return isset($func) ? $func['htmltrim']($var) : trim($var, " \t\n\r\x0B\0\xA0");

	// Go through all the elements and remove the whitespace.
	foreach ($var as $k => $v)
		$var[$k] = $level > 25 ? null : htmltrim__recursive($v, $level + 1);

	return $var;
]]></search>
			<add><![CDATA[
	if (!is_array($var))
		return isset($func) ? $func['htmltrim']($var) : trim($var, " \t\n\r\x0B\0\xA0");

	$new_var = array();

	// Go through all the elements and remove the whitespace.
	foreach ($var as $k => $v)
		$new_var[$k] = $level > 25 ? null : htmltrim__recursive($v, $level + 1);

	return $new_var;
]]></add>
		</operation>
	</file>


	<file name="$sourcedir/Search.php">
		<!--
			Again, two operations that should achieve the same thing for two
			different versions of Search.php
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
		$_REQUEST['brd'] = $search_params['brd'];

	// Ensure that brd is an array.
	if (!is_array($_REQUEST['brd']) && !empty($_REQUEST['brd']))
		$_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

	// Make sure all boards are integers.
]]></search>
			<add><![CDATA[
		$_REQUEST['brd'] = $search_params['brd'];

	// Ensure that brd is an array.
	if (!empty($_REQUEST['brd']) && !is_array($_REQUEST['brd']))
		$_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

	// Make sure all boards are integers.
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
		$_REQUEST['brd'] = $search_params['brd'];

	// Make sure all boards are integers.
]]></search>
			<add><![CDATA[
		$_REQUEST['brd'] = $search_params['brd'];

	// Ensure that brd is an array.
	if (!empty($_REQUEST['brd']) && !is_array($_REQUEST['brd']))
		$_REQUEST['brd'] = strpos($_REQUEST['brd'], ',') !== false ? explode(',', $_REQUEST['brd']) : array($_REQUEST['brd']);

	// Make sure all boards are integers.
]]></add>
		</operation>
		<!--
			This operation is only needed in _some_ versions.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
			elseif ($_SESSION['search_cache']['num_results'] === -1)
]]></search>
			<add><![CDATA[
			elseif ($_SESSION['search_cache']['num_results'] == -1)
]]></add>
		</operation>
	</file>


	<file name="$sourcedir/Post.php">
		<!--
			These operations are only needed in _some_ versions.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
			if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + $modSettings['edit_disable_time'] * 60 < time())
]]></search>
			<add><![CDATA[
			if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time())
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
	include_once($sourcedir . '/Subs-Post.php');

	$request = db_query("
]]></search>
			<add><![CDATA[
	include_once($sourcedir . '/Subs-Post.php');

	$moderate_boards = boardsAllowedTo('moderate_board');

	$request = db_query("
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
 			AND (t.locked = 0' . (empty($moderate_boards) ? '' : ' OR b.ID_BOARD IN (' . implode(', ', $moderate_boards)) . ')') . "
]]></search>
			<add><![CDATA[
 			AND (t.locked = 0' . (empty($moderate_boards) ? '' : ' OR b.ID_BOARD IN (' . implode(', ', $moderate_boards) . ')') . ')') . "
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
				modifiedTime, modifiedName
]]></search>
			<add><![CDATA[
				m.modifiedTime, m.modifiedName
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
				'body' => stripslashes($msgOptions['body']),
]]></search>
			<!--
				The replacement below is no CDATA block! In case this
				modification is done manually make sure the following is
				replaced: '&gt;' into '>' and '&lt;' into '<'.
			-->
			<add>
				'body' => strtr(stripslashes($msgOptions['body']), array(']]&gt;' => ']]]]&gt;&lt;![CDATA[&gt;')),
</add>
		</operation>
	</file>


	<file name="$sourcedir/Subs-Post.php">
		<!--
			This operation is only needed in _some_ versions.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
				$parts[$i] = preg_replace('~(?:\A|\n)/me(?: |&nbsp;)([^\n\z]*)~i', '[me=&quot;' . $user_info['name'] . '&quot;]$1[/me]', $parts[$i]);
			else
				$parts[$i] = preg_replace('~(?:\A|\n)/me(?: |&nbsp;)([^\n\z]*)~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
]]></search>
			<add><![CDATA[
				$parts[$i] = preg_replace('~(?:\A|\n)/me(?: |&nbsp;)([^\n]*)(?:\z)?~i', '[me=&quot;' . $user_info['name'] . '&quot;]$1[/me]', $parts[$i]);
			else
				$parts[$i] = preg_replace('~(?:\A|\n)/me(?: |&nbsp;)([^\n]*)(?:\z)?~i', '[me=' . $user_info['name'] . ']$1[/me]', $parts[$i]);
]]></add>
		</operation>
	</file>


	<file name="$sourcedir/Subs-Package.php">
		<!--
			There are two possible versions around, take your pick.
		-->
		<operation error="ignore">
			<search position="replace"><![CDATA[
* Software Version:           SMF 1.1.2                                           *
]]></search>
			<add><![CDATA[
* Software Version:           SMF 1.1.5                                           *
]]></add>
		</operation>
		<operation error="ignore">
			<search position="replace"><![CDATA[
* Software Version:           SMF 1.1.3                                           *
]]></search>
			<add><![CDATA[
* Software Version:           SMF 1.1.5                                           *
]]></add>
		</operation>
	</file>


</modification>