Advertisement:

Navigation

Readme

This patch file will update your forum to SMF 1.0.6.

File Edits

./SSI.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0.3 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
krsort($return['users']);

if (!empty($return['users']))
$return['users'][array_pop(array_keys($return['users']))]['is_last'] = true;
Replace With: [Select]
if (!empty($return['users']))
{
krsort($return['users']);
$userlist = array_keys($return['users']);
$return['users'][$userlist[count($userlist) - 1]]['is_last'] = true;
}

Operation #3
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #4
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
This operation isn't vital to the installation of this mod.

Operation #5
Find: [Select]

FROM {$db_prefix}polls AS p, {$db_prefix}boards AS b, {$db_prefix}topics AS t" . ($topPollInstead ? ", {$db_prefix}poll_choices AS pc" : '') . "
Replace With: [Select]

FROM ({$db_prefix}polls AS p, {$db_prefix}boards AS b, {$db_prefix}topics AS t" . ($topPollInstead ? ", {$db_prefix}poll_choices AS pc" : '') . ")
This operation isn't vital to the installation of this mod.

Operation #6
Find: [Select]

FROM {$db_prefix}polls AS p, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}polls AS p, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #7
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
This operation isn't vital to the installation of this mod.

./changelog.txt

Operation #1
Find: [Select]
SMF 1.0.4 June 7, 2005
================================================================================
June 2005:
--------------------------------------------------------------------------------
Add Before: [Select]
SMF 1.0.6 15 January 2006
================================================================================
December 2005:
--------------------------------------------------------------------------------
! Added PHP 4.4.0 Compatibility Fix. (Subs.php)
! Added MySQL 5.0.12 Compatibility Fix. (Numerous Files)
! Added additional checks to the database query function to reduce the risk of SQL injections. (Subs.php)


November 2005:
--------------------------------------------------------------------------------
! The IPB 2 converter didn't convert all members if the same email address was used twice. (invision2_to_smf.php)
! The YaBB converter didn't convert attachments properly. (yabb_to_smf.php)


October 2005:
--------------------------------------------------------------------------------
! Fixed a PHP 5.0.5 compatibility issue causing ssi_whosOnline() to malfunction. (SSI.php)


July 2005:
--------------------------------------------------------------------------------
! Finally fixed the nasty bug that was removing theme options. (Profile.php)
! Increase the strictness of the icon filename check. (Post.php)
! Make sure to check the moderator's session on lock/sticky. (LockTopic.php)
! Remove some package servers from the default list. (server.list)


./index.php

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

./Sources/LockTopic.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
// Just quit if there's no topic to lock.
if (empty($topic))
fatal_lang_error(472, false);
Add After: [Select]

checkSession('get');

Operation #3
Find: [Select]
// Make sure the user can sticky it, and they are stickying *something*.
isAllowedTo('make_sticky');
Add After: [Select]

checkSession('get');

./Sources/ManageMembers.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0.5 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER=ban.ID_MEMBER)
Replace With: [Select]
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = ban.ID_MEMBER)

./Sources/Memberlist.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
if (!is_numeric($_REQUEST['start']))
{
Add After: [Select]
$_REQUEST['start'] = strtolower(substr($_REQUEST['start'], 0, 1));

if (preg_match('~([\da-z])~', $_REQUEST['start'], $match) == false)
fatal_error('Hacker?', false);

Operation #3
Find: [Select]
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '" . strtolower($_REQUEST['start']) . "'", __FILE__, __LINE__);
Replace With: [Select]
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '$_REQUEST[start]'", __FILE__, __LINE__);

./Sources/Post.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0.5 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
$context['icon'] = $_REQUEST['icon'];
Replace With: [Select]
$context['icon'] = preg_replace('~[\./\\\\*:"<>]~', '', $_REQUEST['icon']);
Operation #3
Find: [Select]
$_POST['icon'] = preg_replace('~[./\\*:]~', '', $_POST['icon']);
Replace With: [Select]
$_POST['icon'] = preg_replace('~[\./\\\\*:"<>]~', '', $_POST['icon']);
Operation #4
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MSG = m.ID_MSG)
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t)
LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MSG = m.ID_MSG)
This operation isn't vital to the installation of this mod.

Operation #5
Find: [Select]

SELECT m.subject, IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime, m.body
FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
Replace With: [Select]

SELECT m.subject, IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime, m.body
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #6
Find: [Select]

SELECT IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime, m.body, m.ID_TOPIC
FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
Replace With: [Select]

SELECT IFNULL(mem.realName, m.posterName) AS posterName, m.posterTime, m.body, m.ID_TOPIC
FROM ({$db_prefix}messages AS m, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

./Sources/Profile.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0.5 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
AND variable IN ('" . implode("', '", $erase_options) . "')", __FILE__, __LINE__);
Replace With: [Select]
AND variable IN ('" . implode("', '", $erase_options) . "')
AND ID_MEMBER = $memID", __FILE__, __LINE__);

Operation #3
Find: [Select]

FROM {$db_prefix}log_notify AS ln, {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
Replace With: [Select]

FROM ({$db_prefix}log_notify AS ln, {$db_prefix}boards AS b)
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
This operation isn't vital to the installation of this mod.

Operation #4
Find: [Select]

FROM {$db_prefix}log_notify AS ln, {$db_prefix}boards AS b, {$db_prefix}topics AS t, {$db_prefix}messages AS ms, {$db_prefix}messages AS ml
Replace With: [Select]

FROM ({$db_prefix}log_notify AS ln, {$db_prefix}boards AS b, {$db_prefix}topics AS t, {$db_prefix}messages AS ms, {$db_prefix}messages AS ml)
This operation isn't vital to the installation of this mod.

./Sources/Subs.php

Operation #1
Find: [Select]
* Software Version: SMF 1.0.4 *
Replace With: [Select]
* Software Version: SMF 1.0.6 *
Operation #2
Find: [Select]
global $db_cache, $db_count, $db_connection;
Replace With: [Select]
global $db_cache, $db_count, $db_connection, $modSettings;
Operation #3
Find: [Select]
$st = explode(' ', microtime());
}
Add After: [Select]

// First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.
if (empty($modSettings['disableQueryCheck']))
{
$clean = '';
$old_pos = 0;
$pos = -1;
while (true)
{
$pos = strpos($db_string, '\'', $pos + 1);
if ($pos === false)
break;
$clean .= substr($db_string, $old_pos, $pos - $old_pos);

while (true)
{
$pos1 = strpos($db_string, '\'', $pos + 1);
$pos2 = strpos($db_string, '\\', $pos + 1);
if ($pos1 === false)
break;
elseif ($pos2 == false || $pos2 > $pos1)
{
$pos = $pos1;
break;
}

$pos = $pos2 + 1;
}
$clean .= '%s';

$old_pos = $pos + 1;
}
$clean .= substr($db_string, $old_pos);
$clean = trim(strtolower(preg_replace(array('~\s+~s', '~/\*!40001 SQL_NO_CACHE \*/~', '~/\*!40000 USE INDEX \([A-Za-z\_]+?\) \*/~'), array(' ', '', ''), $clean)));

// We don't use UNION in SMF, at least so far. But it's useful for injections.
if (strpos($clean, 'union') !== false && preg_match('~(^|[^a-z])union($|[^[a-z])~s', $clean) != 0)
$fail = true;
// Comments? We don't use comments in our queries, we leave 'em outside!
elseif (strpos($clean, '/*') > 2 || strpos($clean, '--') !== false)
$fail = true;
// Trying to change passwords, slow us down, or something?
elseif (strpos($clean, 'set password') !== false && preg_match('~(^|[^a-z])set password($|[^[a-z])~s', $clean) != 0)
$fail = true;
elseif (strpos($clean, 'benchmark') !== false && preg_match('~(^|[^a-z])benchmark($|[^[a-z])~s', $clean) != 0)
$fail = true;
// Sub selects? We don't use those either.
elseif (preg_match('~\([^)]*?select~s', $clean) != 0)
$fail = true;

if (!empty($fail))
{
log_error('Hacking attempt...' . "\n" . $db_string, $file, $line);
fatal_error('Hacking attempt...', false);
}
}

Operation #4
Find: [Select]
// A named email address. [email=me@some.place.com]me[/email] And, you can't have []s in your email, I should know.
'~\[email=(.+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '"$2 ($1)"' : '"<a href=\"mailto:" . strtr("$1", array("\"" => "&quot;", "]" => "", "[" => "")) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// An image. Width and height can be are optional.
'~\[img(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*(.+?)(?:<br />)*\[/img\]~ie' => isset($disabled['img']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;")))' : '"<img src=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;", "\"" => "&quot;"))) . "\" alt=\"\"" . ("$2" != "" ? " width=\"$2\"" : "") . ("$4" != "" ? " height=\"$4\"" : "") . " border=\"0\" />"',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=(.+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"' : 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[iurl\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"' : '"$1"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">$1</a>"',
// FTP link. Named...? [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$1")' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array("@" => "&#64;"))) . "</a>"',
'~\[ftp=(.+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^:\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace("~(\[url.*?\]|\[/url\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[url=(.+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '"$2 ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . strtr("$2", array("@" => "&#64;")) . "</a>"',
'~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~ie' => isset($disabled['url']) ? '"$1"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"',
Replace With: [Select]
// A named email address. [email=me@some.place.com]me[/email] And, you can't have []s in your email, I should know.
'~\[email=([^<">]+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '"$2 ($1)"' : '"<a href=\"mailto:" . strtr("$1", array("\"" => "&quot;", "]" => "", "[" => "")) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// An image. Width and height can be are optional.
'~\[img(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*([^<">]+?)(?:<br />)*\[/img\]~ie' => isset($disabled['img']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;")))' : '"<img src=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "&#64;", "\"" => "&quot;"))) . "\" alt=\"\"" . ("$2" != "" ? " width=\"$2\"" : "") . ("$4" != "" ? " height=\"$4\"" : "") . " border=\"0\" />"',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=([^<">]+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[flash.*?\]|\[/flash\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"' : 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[iurl\]([^<">]+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"' : '"$1"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\">$1</a>"',
// FTP link. Named...? [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\]([^<">]+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$1")' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array("@" => "&#64;"))) . "</a>"',
'~\[ftp=([^<">]+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^:\]<">]+?)\]([^\]]*?\[url(?:=[^\]<">]+?)?\][^<">]+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace("~(\[url.*?\]|\[/url\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\])~i", "", strtr("$2", array("@" => "&#64;"))) . "</a>"',
'~\[url=([^<">]+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '"$2 ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">" . strtr("$2", array("@" => "&#64;")) . "</a>"',
'~\[url\](?:<br />)*([^<">]+?)(?:<br />)*\[/url\]~ie' => isset($disabled['url']) ? '"$1"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => "&#58;", "\"" => "&quot;"))) . "\" target=\"_blank\">$1</a>"',

Operation #5
Find: [Select]
&mysql_query
Replace With: [Select]
mysql_query
This operation isn't vital to the installation of this mod.

./Sources/BoardIndex.php

Operation #1
Find: [Select]

FROM {$db_prefix}categories AS c, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}categories AS c, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

./Sources/Display.php

Operation #1
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS ms
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ms)
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)
This operation isn't vital to the installation of this mod.

./Sources/InstantMessage.php

Operation #1
Find: [Select]

FROM {$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? '' : ", {$db_prefix}im_recipients AS pmr") . "
Replace With: [Select]

FROM ({$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? '' : ", {$db_prefix}im_recipients AS pmr") . ")
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]

FROM {$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? ($context['sort_by'] == 'name' ? "
LEFT JOIN {$db_prefix}im_recipients AS pmr ON (pmr.ID_PM = pm.ID_PM)" : '') : ", {$db_prefix}im_recipients AS pmr") . ($context['sort_by'] == 'name' ? ("
Replace With: [Select]

FROM ({$db_prefix}instant_messages AS pm" . ($context['folder'] == 'outbox' ? ')' . ($context['sort_by'] == 'name' ? "
LEFT JOIN {$db_prefix}im_recipients AS pmr ON (pmr.ID_PM = pm.ID_PM)" : '') : ", {$db_prefix}im_recipients AS pmr)") . ($context['sort_by'] == 'name' ? ("
This operation isn't vital to the installation of this mod.

./Sources/Load.php

Operation #1
Find: [Select]

FROM {$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . "
Replace With: [Select]

FROM ({$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . ")
This operation isn't vital to the installation of this mod.

./Sources/ManageAttachments.php

Operation #1
Find: [Select]

FROM {$db_prefix}attachments AS a, {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}messages AS mf
Replace With: [Select]

FROM ({$db_prefix}attachments AS a, {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}messages AS mf)
This operation isn't vital to the installation of this mod.

./Sources/ManagePermissions.php

Operation #1
Find: [Select]

FROM {$db_prefix}boards AS b, {$db_prefix}categories AS c
Replace With: [Select]

FROM ({$db_prefix}boards AS b, {$db_prefix}categories AS c)
This operation isn't vital to the installation of this mod.

./Sources/MessageIndex.php

Operation #1
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf)
This operation isn't vital to the installation of this mod.

./Sources/MoveTopic.php

Operation #1
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}log_mark_read AS lmr
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}log_mark_read AS lmr)
This operation isn't vital to the installation of this mod.

./Sources/News.php

Operation #1
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}messages AS mf, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}messages AS mf, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

./Sources/Poll.php

Operation #1
Find: [Select]

FROM {$db_prefix}polls AS p, {$db_prefix}topics AS t
Replace With: [Select]

FROM ({$db_prefix}polls AS p, {$db_prefix}topics AS t)
This operation isn't vital to the installation of this mod.

./Sources/Recent.php

Operation #1
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}messages AS m2, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c)
This operation isn't vital to the installation of this mod.

Operation #3
Find: [Select]

FROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: [Select]

FROM ({$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #4
Find: [Select]

$min_message = (int) $min_message;

$request = db_query("
SELECT $select_clause
FROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: [Select]

$min_message = (int) $min_message;

$request = db_query("
SELECT $select_clause
FROM ({$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

Operation #5
Find: [Select]

SELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)
FROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m
Replace With: [Select]

SELECT COUNT(DISTINCT t.ID_TOPIC), MIN(t.ID_LAST_MSG)
FROM ({$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m)
This operation isn't vital to the installation of this mod.

Operation #6
Find: [Select]

SELECT DISTINCT t.ID_TOPIC
FROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m
Replace With: [Select]

SELECT DISTINCT t.ID_TOPIC
FROM ({$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml, {$db_prefix}messages AS m)
This operation isn't vital to the installation of this mod.

Operation #7
Find: [Select]

return;
}

$request = db_query("
SELECT $select_clause
FROM {$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
Replace With: [Select]

return;
}

$request = db_query("
SELECT $select_clause
FROM ({$db_prefix}messages AS ms, {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
This operation isn't vital to the installation of this mod.

./Sources/Search.php

Operation #1
Find: [Select]

FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c, {$db_prefix}messages AS first_m, {$db_prefix}messages AS last_m
Replace With: [Select]

FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}categories AS c, {$db_prefix}messages AS first_m, {$db_prefix}messages AS last_m)
This operation isn't vital to the installation of this mod.

./Sources/SplitTopics.php

Operation #1
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}messages AS m2
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}messages AS m2)
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]

FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m1, {$db_prefix}messages AS m2
Replace With: [Select]

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m1, {$db_prefix}messages AS m2)
This operation isn't vital to the installation of this mod.