Update to SMF 1.0.5 - Installation Instructions for 1.0.4

Update to SMF 1.0.5

File Edits ALT + Click to collapse all the operations

./index.php

Find: Select
* =========================================================================== *
* Software Version: SMF 1.0.4 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: Select
* =========================================================================== *
* Software Version: SMF 1.0.5 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Find: Select

$forum_version = 'SMF 1.0.4';
Replace With: Select

$forum_version = 'SMF 1.0.5';

./Sources/ManageMembers.php

Find: Select
* =========================================================================== *
* Software Version: SMF 1.0.3 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: Select
* =========================================================================== *
* Software Version: SMF 1.0.5 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Find: Select

// Start!
Replace With: Select

$_REQUEST['id'] = (int) $_REQUEST['id'];

// Start!
Find: Select
FROM {$db_prefix}membergroups
WHERE ID_GROUP = $_REQUEST[id]", __FILE__, __LINE__);
// Not really possible...
Replace With: Select
FROM {$db_prefix}membergroups
WHERE ID_GROUP = $_REQUEST[id]
LIMIT 1", __FILE__, __LINE__);
// Not really possible...
Find: Select
// Create the page indexes.
$context['start'] = $_REQUEST['start'];
$context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID . ';sa=trackUser', $_REQUEST['start'], $totalErrors, 20);
Replace With: Select
// Create the page indexes.
$context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID . ';sa=trackUser', $_REQUEST['start'], $totalErrors, 20);
$context['start'] = $_REQUEST['start'];

./Sources/Post.php

Find: Select
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: Select
* =========================================================================== *
* Software Version: SMF 1.0.5 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Find: Select
require_once($sourcedir . '/ManageAttachments.php');
removeAttachments('a.ID_MSG = ' . $_REQUEST['msg'] . ' AND a.ID_ATTACH NOT IN (' . implode(', ', $_POST['attach_del']) . ')');
}
Replace With: Select
require_once($sourcedir . '/ManageAttachments.php');
removeAttachments('a.ID_MSG = ' . (int) $_REQUEST['msg'] . ' AND a.ID_ATTACH NOT IN (' . implode(', ', $_POST['attach_del']) . ')');
}
Find: Select
FROM {$db_prefix}attachments
WHERE ID_MSG = $_REQUEST[msg]", __FILE__, __LINE__);
list ($quantity, $total_size) = mysql_fetch_row($request);
Replace With: Select
FROM {$db_prefix}attachments
WHERE ID_MSG = " . (int) $_REQUEST['msg'], __FILE__, __LINE__);
list ($quantity, $total_size) = mysql_fetch_row($request);
Find: Select
(" . (!empty($_REQUEST['msg']) ? 'ID_MSG, ' : '') . "filename, size)
VALUES (" . (!empty($_REQUEST['msg']) ? $_REQUEST['msg'] . ', ' : '') . "'" . $_FILES['attachment']['name'][$n] . "', " . $_FILES['attachment']['size'][$n] . ')', __FILE__, __LINE__);
$attachID = db_insert_id();
Replace With: Select
(" . (!empty($_REQUEST['msg']) ? 'ID_MSG, ' : '') . "filename, size)
VALUES (" . (!empty($_REQUEST['msg']) ? (int) $_REQUEST['msg'] . ', ' : '') . "'" . $_FILES['attachment']['name'][$n] . "', " . $_FILES['attachment']['size'][$n] . ')', __FILE__, __LINE__);
$attachID = db_insert_id();
Find: Select
smileysEnabled = " . (isset($_POST['ns']) ? '0' : '1') . "
WHERE ID_MSG = $_REQUEST[msg]
LIMIT 1", __FILE__, __LINE__);
Replace With: Select
smileysEnabled = " . (isset($_POST['ns']) ? '0' : '1') . "
WHERE ID_MSG = " . (int) $_REQUEST['msg'] . "
LIMIT 1", __FILE__, __LINE__);
Find: Select
if (!empty($moderationAction))
logAction('modify', array('topic' => $topic, 'message' => $_REQUEST['msg'], 'member' => $row['ID_MEMBER_POSTER']));
Replace With: Select
if (!empty($moderationAction))
logAction('modify', array('topic' => $topic, 'message' => (int) $_REQUEST['msg'], 'member' => $row['ID_MEMBER_POSTER']));
Find: Select
WHERE m.ID_TOPIC = $topic" . (isset($_REQUEST['msg']) ? "
AND m.ID_MSG < $_REQUEST[msg]" : '') . "
ORDER BY m.ID_MSG DESC" . ($modSettings['topicSummaryPosts'] >= 0 ? '
Replace With: Select
WHERE m.ID_TOPIC = $topic" . (isset($_REQUEST['msg']) ? "
AND m.ID_MSG < " . (int) $_REQUEST['msg'] : '') . "
ORDER BY m.ID_MSG DESC" . ($modSettings['topicSummaryPosts'] >= 0 ? '

./Sources/Profile.php

Find: Select
* =========================================================================== *
* Software Version: SMF 1.0.3 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Replace With: Select
* =========================================================================== *
* Software Version: SMF 1.0.5 *
* Software by: Simple Machines (http://www.simplemachines.org) *
Find: Select

loadThemeOptions($_REQUEST['userID']);
}
Replace With: Select

loadThemeOptions((int) $_REQUEST['userID']);
}

./Sources/Search.php

Find: Select
* SMF: Simple Machines Forum *
* Open-Source Project Inspired by Zef Hemel ([email protected]) *
* =========================================================================== *
* Software Version: SMF 1.0.2 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
Replace With: Select
* SMF: Simple Machines Forum *
* Open-Source Project Inspired by Zef Hemel ([email protected]) *
* =========================================================================== *
* Software Version: SMF 1.0.5 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
Find: Select

// Are you allowed?
isAllowedTo('search_posts');

require_once($sourcedir . '/Display.php');
Replace With: Select

// Are you allowed?
isAllowedTo('search_posts');

// So, we're allowed here, let's clean up the start variable - just incase.
$_REQUEST['start'] = (int) $_REQUEST['start'];

require_once($sourcedir . '/Display.php');

./Sources/Subs-Boards.php

Find: Select
* =========================================================================== *
* Software Version: SMF 1.0 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2004 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
Replace With: Select
* =========================================================================== *
* Software Version: SMF 1.0.5 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
Find: Select
foreach ($_REQUEST['topics'] as $topic)
$_REQUEST['actions'][$topic] = $_REQUEST['qaction'];
}
else
{
// Weird... how'd you get here?
if (empty($_REQUEST['actions']))
redirectexit('board=' . $board . '.' . $_REQUEST['start']);

// Validate each action.
foreach ($_REQUEST['actions'] as $topic => $action)
{
if (!in_array($action, $possibleActions))
unset($_REQUEST['actions'][$topic]);
}
}
Replace With: Select
foreach ($_REQUEST['topics'] as $topic)
$_REQUEST['actions'][(int) $topic] = $_REQUEST['qaction'];
}

// Weird... how'd you get here?
if (empty($_REQUEST['actions']))
redirectexit('board=' . $board . '.' . $_REQUEST['start']);

// Validate each action.
$temp = array();
foreach ($_REQUEST['actions'] as $topic => $action)
{
if (in_array($action, $possibleActions))
$temp[(int) $topic] = $action;
}
$_REQUEST['actions'] = $temp;
Advertisement: