Advertisement:

Navigation

Readme

This patch file will update your forum to SMF 1.1.8.

File Edits

./index.php

Operation #1
Find: [Select]
* Software Version: SMF 1.1.7 *
Replace With: [Select]
* Software Version: SMF 1.1.8 *
Operation #2
Find: [Select]
$forum_version = 'SMF 1.1.7';
Replace With: [Select]
$forum_version = 'SMF 1.1.8';

./Sources/PackageGet.php

Operation #1
Find: [Select]
* Software Version: SMF 1.1.7 *
Replace With: [Select]
* Software Version: SMF 1.1.8 *
Operation #2
Find: [Select]
      // Clear any "relative" URL. Since "server" is not present, "relative" is garbage.
      unset($_GET['relative']);
Replace With: [Select]
      // Clear any "relative" URL. Since "server" is not present, "relative" is garbage.
      unset($_GET['relative']);
      
      $token = checkConfirm('get_absolute_url');
      if ($token !== true)
      {
         $context['sub_template'] = 'package_confirm';
      
         $context['page_title'] = $txt['smf183'];
         $context['confirm_message'] = sprintf($txt['package_confirm_view_package_content'], htmlspecialchars($_GET['absolute']));
         $context['proceed_href'] = $scripturl . '?action=packageget;sa=browse;absolute=' . urlencode($_GET['absolute']) . ';confirm=' . $token;
         
         return;
      }

./Sources/Packages.php

Operation #1
Find: [Select]
* Software Version: SMF 1.1.7 *
Replace With: [Select]
* Software Version: SMF 1.1.8 *
Operation #2
Find: [Select]

function PackageInstallTest()
{
   global $boarddir, $txt, $context, $scripturl, $sourcedir, $modSettings;

   checkSession('get');
Replace With: [Select]

function PackageInstallTest()
{
   global $boarddir, $txt, $context, $scripturl, $sourcedir, $modSettings;

   checkSession('request');
This operation isn't vital to the installation of this mod.

./Sources/Security.php

Operation #1
Find: [Select]
* Software Version: SMF 1.1.6 *
Replace With: [Select]
* Software Version: SMF 1.1.8 *
Operation #2
Find: [Select]
// Check whether a form has been submitted twice.
function checkSubmitOnce($action, $is_fatal = true)
{
Replace With: [Select]
function checkConfirm($action)
{
   global $modSettings;
   
   if (isset($_GET['confirm']) && isset($_SESSION['confirm_' . $action]) && md5($_GET['confirm'] . $_SERVER['HTTP_USER_AGENT']) !== $_SESSION['confirm_' . $action])
      return true;
      
   else
   {
      $token = md5(mt_rand() . session_id() . (string) microtime() . $modSettings['rand_seed']);
      $_SESSION['confirm_' . $action] = md5($token, $_SERVER['HTTP_USER_AGENT']);
      
      return $token;
   }
}

// Check whether a form has been submitted twice.
function checkSubmitOnce($action, $is_fatal = true)
{

./Themes/default/Packages.template.php

Operation #1
Find: [Select]
// Version: 1.1.7; Packages
Replace With: [Select]
// Version: 1.1.8; Packages
Operation #2
Find: [Select]
function template_package_list()
{
Replace With: [Select]
function template_package_confirm()
{
   global $context, $settings, $options, $txt, $scripturl;

   echo '
      <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
         <tr class="titlebg">
            <td>' . $context['page_title'] . '</td>
         </tr>
         <tr>
            <td width="100%" align="left" valign="middle" class="windowbg2">
               ', $context['confirm_message'], '<br />
               <br />
               <a href="', $context['proceed_href'], '">[ ', $txt['package_confirm_proceed'], ' ]</a> <a href="JavaScript:history.go(-1);">[ ', $txt['package_confirm_go_back'], ' ]</a>
            </td>
         </tr>
      </table>';   
}
   
function template_package_list()
{

./Sources/Subs-Post.php

Operation #1
Find: [Select]
* Software Version: SMF 1.1.5 *
Replace With: [Select]
* Software Version: SMF 1.1.8 *
Operation #2
Find: [Select]
      preg_match_all('~\[(' . $myTag . ')=([^\]]*?)\](.+?)\[/(' . $myTag . ')\]~is', $message, $matches);
Replace With: [Select]
      preg_match_all('~\[(' . $myTag . ')=([^\]]*?)\](?:(.+?)\[/(' . $myTag . ')\])?~is', $message, $matches);
Operation #3
Find: [Select]
      if (!$hasEqualSign)
         $this_close = $matches[3][$k];
      else
         $this_close = $matches[4][$k];
Replace With: [Select]
      $this_close = $hasEqualSign ? (empty($matches[4][$k]) ? '' : $matches[4][$k]) : $matches[3][$k];
Operation #4
Find: [Select]
         $replaces['[' . $matches[1][$k] . '=' . $matches[2][$k] . ']' . $matches[3][$k] . '[/' . $matches[4][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']' . $matches[3][$k] . '[/' . $this_close . ']';
Replace With: [Select]
         $replaces[$matches[0][$k]] = '[' . $this_tag . '=' . $replace . ']' . (empty($matches[4][$k]) ? '' : $matches[3][$k] . '[/' . $this_close . ']');

./Themes/default/languages/Packages.english.php

Operation #1
Find: [Select]

// Version: 1.1; Packages
Replace With: [Select]

// Version: 1.1.8; Packages
This operation isn't vital to the installation of this mod.

Operation #2
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['package_confirm_view_package_content'] = 'Are you sure you want to view the package contents from this location:<br /><br />%1$s';
$txt['package_confirm_proceed'] = 'Proceed';
$txt['package_confirm_go_back'] = 'Go back';
This operation isn't vital to the installation of this mod.