Update to SMF 1.0.15 - Installation Instructions for 1.0.14

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

File Edits ALT + Click to collapse all the operations

./index.php

Find: Select
* Software Version: SMF 1.0.14 *
Replace With: Select
* Software Version: SMF 1.0.15 *
Find: Select
$forum_version = 'SMF 1.0.14';
Replace With: Select
$forum_version = 'SMF 1.0.15';

./SSI.php

Find: Select
* Software Version: SMF 1.0.14 *
Replace With: Select
* Software Version: SMF 1.0.15 *
Find: Select
if (isset($_REQUEST['ssi_layers']))
{
if ((get_magic_quotes_gpc() ? addslashes($_REQUEST['ssi_layers']) : $_REQUEST['ssi_layers']) == htmlspecialchars($ssi_layers))
die('Hacking attempt...');
}
Replace With: Select
if (isset($_REQUEST['ssi_layers'], $ssi_layers) && (@get_magic_quotes_gpc() ? stripslashes($_REQUEST['ssi_layers']) : $_REQUEST['ssi_layers']) == $ssi_layers)
die('Hacking attempt...');

./Sources/PackageGet.php

Find: Select
* Software Version: SMF 1.0.10 *
Replace With: Select
* Software Version: SMF 1.0.15 *
Find: Select
redirectexit('action=packages;sa=install;package=' . $package_name);
Replace With: Select
redirectexit('action=packages;sa=install;package=' . $package_name . ';sesc=' . $context['session_id']);
Find: Select
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['package11'] . ' ]</a>';
elseif ($context['package']['type'] == 'avatar')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['package12'] . ' ]</a>';
elseif ($context['package']['type'] == 'language')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['package13'] . ' ]</a>';
else
$context['package']['install']['link'] = '';

$context['package']['list_files']['link'] = '<a href="' . $scripturl . '?action=packages;sa=list;package=' . $context['package']['filename'] . '">[ ' . $txt['package14'] . ' ]</a>';

// Free a little bit of memory...
Replace With: Select
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . ';sesc=' . $context['session_id'] . '">[ ' . $txt['package11'] . ' ]</a>';
elseif ($context['package']['type'] == 'avatar')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . ';sesc=' . $context['session_id'] . '">[ ' . $txt['package12'] . ' ]</a>';
elseif ($context['package']['type'] == 'language')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . ';sesc=' . $context['session_id'] . '">[ ' . $txt['package13'] . ' ]</a>';
else
$context['package']['install']['link'] = '';

$context['package']['list_files']['link'] = '<a href="' . $scripturl . '?action=packages;sa=list;package=' . $context['package']['filename'] . '">[ ' . $txt['package14'] . ' ]</a>';

// Free a little bit of memory...
Find: Select
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['package11'] . ' ]</a>';
elseif ($context['package']['type'] == 'avatar')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['package12'] . ' ]</a>';
elseif ($context['package']['type'] == 'language')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . '">[ ' . $txt['package13'] . ' ]</a>';
else
$context['package']['install']['link'] = '';

$context['package']['list_files']['link'] = '<a href="' . $scripturl . '?action=packages;sa=list;package=' . $context['package']['filename'] . '">[ ' . $txt['package14'] . ' ]</a>';

unset($context['package']['xml']);
Replace With: Select
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . ';sesc=' . $context['session_id'] . '">[ ' . $txt['package11'] . ' ]</a>';
elseif ($context['package']['type'] == 'avatar')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . ';sesc=' . $context['session_id'] . '">[ ' . $txt['package12'] . ' ]</a>';
elseif ($context['package']['type'] == 'language')
$context['package']['install']['link'] = '<a href="' . $scripturl . '?action=packages;sa=install;package=' . $context['package']['filename'] . ';sesc=' . $context['session_id'] . '">[ ' . $txt['package13'] . ' ]</a>';
else
$context['package']['install']['link'] = '';

$context['package']['list_files']['link'] = '<a href="' . $scripturl . '?action=packages;sa=list;package=' . $context['package']['filename'] . '">[ ' . $txt['package14'] . ' ]</a>';

unset($context['package']['xml']);

./Sources/Packages.php

Find: Select
* Software Version: SMF 1.0.10 *
Replace With: Select
* Software Version: SMF 1.0.15 *
Find: Select
// Test install a package.
function PackageInstallTest()
{
global $boarddir, $txt, $context, $scripturl, $sourcedir, $modSettings;

// You have to specify a file!!
if (!isset($_REQUEST['package']) || $_REQUEST['package'] == '')
Replace With: Select
// Test install a package.
function PackageInstallTest()
{
global $boarddir, $txt, $context, $scripturl, $sourcedir, $modSettings;

checkSession('request');

// You have to specify a file!!
if (empty($_REQUEST['package']) || preg_match('~[^\\w0-9.\\-_]~', $_REQUEST['package']) === 1 || strpos($_REQUEST['package'], '..') !== false)
Find: Select
function PackageInstall()
{
global $boarddir, $txt, $context, $scripturl, $sourcedir;

// If there's no file, what are we installing?
if (!isset($_REQUEST['package']) || $_REQUEST['package'] == '')
redirectexit('action=packages');
Replace With: Select
function PackageInstall()
{
global $boarddir, $txt, $context, $scripturl, $sourcedir;

checkSession('get');

// If there's no file, what are we installing?
if (empty($_REQUEST['package']) || preg_match('~[^\\w0-9.\\-_]~', $_REQUEST['package']) === 1 || strpos($_REQUEST['package'], '..') !== false)
redirectexit('action=packages');
Find: Select
function PackageList()
{
global $txt, $scripturl, $boarddir, $context, $sourcedir;

require_once($sourcedir . '/Subs-Package.php');

// No package? Show him or her the door.
if (!isset($_REQUEST['package']) || $_REQUEST['package'] == '')
Replace With: Select
function PackageList()
{
global $txt, $scripturl, $boarddir, $context, $sourcedir;

require_once($sourcedir . '/Subs-Package.php');

// No package? Show him or her the door.
if (empty($_REQUEST['package']) || preg_match('~[^\\w0-9.\\-_]~', $_REQUEST['package']) === 1 || strpos($_REQUEST['package'], '..') !== false)
Find: Select
function ExamineFile()
{
global $txt, $scripturl, $boarddir, $context, $sourcedir;

require_once($sourcedir . '/Subs-Package.php');

// No package? Show him or her the door.
if (!isset($_REQUEST['package']) || $_REQUEST['package'] == '')
Replace With: Select
function ExamineFile()
{
global $txt, $scripturl, $boarddir, $context, $sourcedir;

checkSession('get');

require_once($sourcedir . '/Subs-Package.php');

// No package? Show him or her the door.
if (empty($_REQUEST['package']) || preg_match('~[^\\w0-9.\\-_]~', $_REQUEST['package']) === 1 || strpos($_REQUEST['package'], '..') !== false)
Find: Select
$context['filedata'] = '<img src="' . $scripturl . '?action=packages;sa=examine;package=' . $_REQUEST['package'] . ';file=' . $_REQUEST['file'] . ';raw" alt="' . $_REQUEST['file'] . '" />';
Replace With: Select
$context['filedata'] = '<img src="' . $scripturl . '?action=packages;sa=examine;package=' . $_REQUEST['package'] . ';file=' . $_REQUEST['file'] . ';raw;sesc=' . $context['session_id'] . '" alt="' . $_REQUEST['file'] . '" />';
Find: Select
function FlushInstall()
{
global $boarddir;
Replace With: Select
function FlushInstall()
{
global $boarddir;

checkSession('get');
Find: Select
// Delete a package.
function PackageRemove()
{
global $scripturl, $boarddir;
Replace With: Select
// Delete a package.
function PackageRemove()
{
global $scripturl, $boarddir;

checkSession('get');

./Sources/QueryString.php

Find: Select
* Software Version: SMF 1.0.13 *
Replace With: Select
* Software Version: SMF 1.0.15 *
Find: Select
parse_str(preg_replace('/&(\w+)(&|$)/', '&$1=$2', strtr($_SERVER['QUERY_STRING'], ';', '&')), $_GET);
Replace With: Select
parse_str(preg_replace('/&(\w+)(&|$)/', '&$1=$2', strtr($_SERVER['QUERY_STRING'], array(';?' => '&', ';' => '&', '%00' => '', "\0" => ''))), $_GET);

./Sources/Themes.php

Find: Select
* Software Version: SMF 1.0.10 *
Replace With: Select
* Software Version: SMF 1.0.15 *
Find: Select
// Use a specific theme?
Replace With: Select
$reservedVars = array(
'actual_theme_url',
'actual_images_url',
'base_theme_dir',
'base_theme_url',
'default_images_url',
'default_theme_dir',
'default_theme_url',
'default_template',
'images_url',
'number_recent_posts',
'smiley_sets_default',
'theme_dir',
'theme_id',
'theme_layers',
'theme_templates',
'theme_url',
);

// Can't change reserved vars.
if (in_array(strtolower($_GET['var']), $reservedVars))
redirectexit($settings['images_url'] . '/blank.gif');

// Use a specific theme?

./Themes/default/Packages.template.php

Find: Select
</form>';
}

echo '
</td>
</tr>';
}

echo '
</table>';
}

function template_extract_package()
Replace With: Select
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}

echo '
</td>
</tr>';
}

echo '
</table>';
}

function template_extract_package()
Find: Select
if (!$context['ftp_needed'])
echo '
<a href="', $scripturl, '?action=packages;sa=', $context['uninstalling'] ? 'uninstall2' : 'install2', ';package=', $context['filename'], '">[ ', $txt['smf154'], ' ]</a>';
Replace With: Select
if (!$context['ftp_needed'])
echo '
<a href="', $scripturl, '?action=packages;sa=', $context['uninstalling'] ? 'uninstall2' : 'install2', ';package=', $context['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['smf154'], ' ]</a>';
Find: Select
<li><a href="', $scripturl, '?action=packages;sa=examine;package=', $context['filename'], ';file=', $fileinfo['filename'], '" title="', $txt[305], '">', $fileinfo['filename'], '</a> (', $fileinfo['size'], ' ', $txt['package_bytes'], ')</li>';
Replace With: Select
<li><a href="', $scripturl, '?action=packages;sa=examine;package=', $context['filename'], ';file=', $fileinfo['filename'], ';sesc=', $context['session_id'], '" title="', $txt[305], '">', $fileinfo['filename'], '</a> (', $fileinfo['size'], ' ', $txt['package_bytes'], ')</li>';
Find: Select
<td>', $file['version'], '</td>
<td align="right"><a href="', $scripturl, '?action=packages;sa=uninstall;package=', $file['filename'], '">[ ', $txt['smf198b'], ' ]</a></td>
</tr>';

echo '
</table>
<br />
<a href="', $scripturl, '?action=packages;sa=flush">[ ', $txt['smf198d'], ' ]</a>';
Replace With: Select
<td>', $file['version'], '</td>
<td align="right"><a href="', $scripturl, '?action=packages;sa=uninstall;package=', $file['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['smf198b'], ' ]</a></td>
</tr>';

echo '
</table>
<br />
<a href="', $scripturl, '?action=packages;sa=flush;sesc=', $context['session_id'], '">[ ', $txt['smf198d'], ' ]</a>';
Find: Select
foreach ($context['available_mods'] as $i => $package)
{
echo '
<tr>
<td>', ++$i, '.</td>
<td>', $package['name'], '</td>
<td>
', $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" border="0" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], '"', $package['is_installed'] && $package['is_current'] ? ' onclick="return confirm(\'' . $txt['package_delete_bad'] . '\');"' : '', '>[ ', $txt['package52'], ' ]</a>
Replace With: Select
foreach ($context['available_mods'] as $i => $package)
{
echo '
<tr>
<td>', ++$i, '.</td>
<td>', $package['name'], '</td>
<td>
', $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], ';sesc=', $context['session_id'], '"', $package['is_installed'] && $package['is_current'] ? ' onclick="return confirm(\'' . $txt['package_delete_bad'] . '\');"' : '', '>[ ', $txt['package52'], ' ]</a>
Find: Select
foreach ($context['available_avatars'] as $i => $package)
{
echo '
<tr>
<td>', ++$i, '.</td>
<td>', $package['name'], '</td>
<td>', $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" border="0" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], '">[ ', $txt['package52'], ' ]</a>
Replace With: Select
foreach ($context['available_avatars'] as $i => $package)
{
echo '
<tr>
<td>', ++$i, '.</td>
<td>', $package['name'], '</td>
<td>', $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package52'], ' ]</a>
Find: Select
foreach ($context['available_languages'] as $i => $package)
{
echo '
<tr>
<td>' . ++$i . '.</td>
<td>' . $package['name'] . '</td>
<td>' . $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" border="0" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], '">[ ', $txt['package52'], ' ]</a>
Replace With: Select
foreach ($context['available_languages'] as $i => $package)
{
echo '
<tr>
<td>' . ++$i . '.</td>
<td>' . $package['name'] . '</td>
<td>' . $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package52'], ' ]</a>
Find: Select
foreach ($context['available_other'] as $i => $package)
{
echo '
<tr>
<td>' . ++$i . '.</td>
<td>' . $package['name'] . '</td>
<td>' . $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" border="0" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], '"', $package['is_installed'] ? ' onclick="return confirm(\'' . $txt['package_delete_bad'] . '\');"' : '', '>[ ', $txt['package52'], ' ]</a>
Replace With: Select
foreach ($context['available_other'] as $i => $package)
{
echo '
<tr>
<td>' . ++$i . '.</td>
<td>' . $package['name'] . '</td>
<td>' . $package['version'];

if ($package['is_installed'] && !$package['is_newer'])
echo '
<img src="', $settings['images_url'], '/icons/package_', $package['is_current'] ? 'installed' : 'old', '.gif" alt="" width="12" height="11" align="middle" style="margin-left: 2ex;" />';

echo '
</td>
<td align="right">';

if ($package['can_uninstall'])
echo '
<a href="', $scripturl, '?action=packages;sa=uninstall;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['smf198b'], ' ]</a>';
elseif ($package['can_upgrade'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package_upgrade'], ' ]</a>';
elseif ($package['can_install'])
echo '
<a href="', $scripturl, '?action=packages;sa=install;package=', $package['filename'], ';sesc=', $context['session_id'], '">[ ', $txt['package11'], ' ]</a>';

echo '
<a href="', $scripturl, '?action=packages;sa=list;package=', $package['filename'], '">[ ', $txt['package14'], ' ]</a>
<a href="', $scripturl, '?action=packages;sa=remove;package=', $package['filename'], ';sesc=', $context['session_id'], '"', $package['is_installed'] ? ' onclick="return confirm(\'' . $txt['package_delete_bad'] . '\');"' : '', '>[ ', $txt['package52'], ' ]</a>

File Operations

Move the included file ".htaccess" to "./Packages".
Advertisement: