Author Topic: ดำเนินการ Update ระบบ SMF 2.0.11 to 2.0.12 patched  (Read 5912 times)

0 Members and 1 Guest are viewing this topic.

Offline Nick

  • Administrator
  • Platinum Member
  • *
  • Posts: 46028
  • Karma: +1000/-0
  • Gender: Male
  • NickCS
    • http://www.facebook.com/nickcomputerservices
    • http://www.twitter.com/nickcomputer
    • Computer Chiangmai

http://custom.simplemachines.org/upgrades/index.php?action=upgrade;file=smf_patch_2.0.12.zip;smf_version=2.0.11
ดำเนินการ Update ระบบ SMF 2.0.11 to 2.0.12 patched

This patch will provide important security and bug fixes to your 2.0.11 forum.

Changelog
=========
- Fixed word censor injection by disallowing an empty 'proper word'
- Fixed vulnerable unserialize() code by converting all instances to safe_unserialize()
- Added a more thorough safe_unserialize() function to prevent object injection
- Fixed bug where leaving a custom profile field blank on registration that has an email mask would throw an error
- Fixed PayPal integration to comply with their new forced SSL policy
- Fixed bug where notifications were sent for messages in inaccessible boards
- Fixed editor to make the editor work with Microsoft Edge
- Fixed issue where smiley popup window is blank on iOS 9 devices
- Fixed WYSIWYG editor in mobile devices
- Fixed an undefined $_POST['icon'] in Sources/Post.php
- Fixed a minor bug in Login2()
- Fixed an issue where SMF doesn't recognize new domain names and considers these as invalid
- Fixed an issue where SMF would allow empty BBC
- Fixed an issue where theme variants could not be selected
- Fixed an issue where the file version of Subs-Post.php could have been 2.0.8 or 2.0.11. It will be updated to 2.0.12 in either case.

Quote
File Edits
./index.php
Operation #1
Find: [Select]
* @version 2.0.11
Replace With: [Select]
* @version 2.0.12

Operation #2
Find: [Select]
$forum_version = 'SMF 2.0.11';
Replace With: [Select]
$forum_version = 'SMF 2.0.12';

./Themes/default/languages/index.english.php
Operation #1
Find: [Select]
// Version: 2.0.10; index
Replace With: [Select]
// Version: 2.0.12; index
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]
 <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2015</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';
Replace With: [Select]
 <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2016</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/index.english-utf8.php
Operation #1
Find: [Select]
// Version: 2.0.10; index
Replace With: [Select]
// Version: 2.0.12; index
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]
 <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2015</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';
Replace With: [Select]
 <a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2016</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>';
This operation isn't vital to the installation of this mod.

./Sources/Admin.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
Replace With: [Select]
$context['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();

./Sources/Calendar.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.11

Operation #2
Find: [Select]
$context['clockicons'] = unserialize(base64_decode('YTo2OntzOjI6ImgxIjthOjI6e2k6MDtpOjI7aToxO2k6MTt9czoyOiJoMiI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjI6Im0xIjthOjM6e2k6MDtpOjQ7aToxO2k6MjtpOjI7aToxO31zOjI6Im0yIjthOjQ6e2k6MDtpOjg7aToxO2k6NDtpOjI7aToyO2k6MztpOjE7fXM6MjoiczEiO2E6Mzp7aTowO2k6NDtpOjE7aToyO2k6MjtpOjE7fXM6MjoiczIiO2E6NDp7aTowO2k6ODtpOjE7aTo0O2k6MjtpOjI7aTozO2k6MTt9fQ=='));
Replace With: [Select]
$context['clockicons'] = safe_unserialize(base64_decode('YTo2OntzOjI6ImgxIjthOjI6e2k6MDtpOjI7aToxO2k6MTt9czoyOiJoMiI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjI6Im0xIjthOjM6e2k6MDtpOjQ7aToxO2k6MjtpOjI7aToxO31zOjI6Im0yIjthOjQ6e2k6MDtpOjg7aToxO2k6NDtpOjI7aToyO2k6MztpOjE7fXM6MjoiczEiO2E6Mzp7aTowO2k6NDtpOjE7aToyO2k6MjtpOjE7fXM6MjoiczIiO2E6NDp7aTowO2k6ODtpOjE7aTo0O2k6MjtpOjI7aTozO2k6MTt9fQ=='));

Operation #3
Find: [Select]
$context['clockicons'] = unserialize(base64_decode('YTozOntzOjE6ImgiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czoxOiJtIjthOjY6e2k6MDtpOjMyO2k6MTtpOjE2O2k6MjtpOjg7aTozO2k6NDtpOjQ7aToyO2k6NTtpOjE7fXM6MToicyI7YTo2OntpOjA7aTozMjtpOjE7aToxNjtpOjI7aTo4O2k6MztpOjQ7aTo0O2k6MjtpOjU7aToxO319'));
Replace With: [Select]
$context['clockicons'] = safe_unserialize(base64_decode('YTozOntzOjE6ImgiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czoxOiJtIjthOjY6e2k6MDtpOjMyO2k6MTtpOjE2O2k6MjtpOjg7aTozO2k6NDtpOjQ7aToyO2k6NTtpOjE7fXM6MToicyI7YTo2OntpOjA7aTozMjtpOjE7aToxNjtpOjI7aTo4O2k6MztpOjQ7aTo0O2k6MjtpOjU7aToxO319'));

Operation #4
Find: [Select]
$context['clockicons'] = unserialize(base64_decode('YTo2OntzOjQ6InllYXIiO2E6Nzp7aTowO2k6NjQ7aToxO2k6MzI7aToyO2k6MTY7aTozO2k6ODtpOjQ7aTo0O2k6NTtpOjI7aTo2O2k6MTt9czo1OiJtb250aCI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjM6ImRheSI7YTo1OntpOjA7aToxNjtpOjE7aTo4O2k6MjtpOjQ7aTozO2k6MjtpOjQ7aToxO31zOjQ6ImhvdXIiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czozOiJtaW4iO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9czozOiJzZWMiO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9fQ=='));
Replace With: [Select]
$context['clockicons'] = safe_unserialize(base64_decode('YTo2OntzOjQ6InllYXIiO2E6Nzp7aTowO2k6NjQ7aToxO2k6MzI7aToyO2k6MTY7aTozO2k6ODtpOjQ7aTo0O2k6NTtpOjI7aTo2O2k6MTt9czo1OiJtb250aCI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjM6ImRheSI7YTo1OntpOjA7aToxNjtpOjE7aTo4O2k6MjtpOjQ7aTozO2k6MjtpOjQ7aToxO31zOjQ6ImhvdXIiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czozOiJtaW4iO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9czozOiJzZWMiO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9fQ=='));

./Sources/DbPackages-mysql.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column['unsigned']) ? 'unsigned ' : '';
Replace With: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

Operation #3
Find: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';
Replace With: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

Operation #4
Find: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';
Replace With: [Select]
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

./Sources/Display.php
Operation #1
Find: [Select]
@version 2.0.9
Replace With: [Select]
@version 2.0.11

Operation #2
Find: [Select]
$modSettings['attachmentUploadDir'] = @unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

./Sources/Load.php
Operation #1
Find: [Select]
@version 2.0.11
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$integration_settings = unserialize(SMF_INTEGRATION_SETTINGS);
Replace With: [Select]
$integration_settings = safe_unserialize(SMF_INTEGRATION_SETTINGS);

Operation #3
Find: [Select]
$context['display_fields'] = unserialize($modSettings['displayFields']);
Replace With: [Select]
$context['display_fields'] = safe_unserialize($modSettings['displayFields']);

Operation #4
Find: [Select]
return @unserialize($value);
Replace With: [Select]
return safe_unserialize($value);

./Sources/LogInOut.php
Operation #1
Find: [Select]
@version 2.0.11
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 || $_POST['cookielength'] <= 525600))
Replace With: [Select]
elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 && $_POST['cookielength'] <= 525600))

./Sources/ManageAttachments.php
Operation #1
Find: [Select]
@version 2.0.10
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$attach_dirs = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$attach_dirs = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #3
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #4
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #5
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

./Sources/ManagePaid.php
Operation #1
Find: [Select]
@version 2.0.3
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
'cost' => @unserialize($row['cost']),
Replace With: [Select]
'cost' => safe_unserialize($row['cost']),

Operation #3
Find: [Select]
$pending_details = @unserialize($row['pending_details']);
Replace With: [Select]
$pending_details = safe_unserialize($row['pending_details']);

Operation #4
Find: [Select]
$costs = @unserialize($context['current_subscription']['real_cost']);
Replace With: [Select]
$costs = safe_unserialize($context['current_subscription']['real_cost']);

Operation #5
Find: [Select]
$costs = @unserialize($row['cost']);
Replace With: [Select]
$costs = safe_unserialize($row['cost']);

./Sources/ManagePosts.php
Operation #1
Find: [Select]
      if (empty($censor_vulgar[$i]))
         continue;
Add After: [Select]

      if (empty($censor_proper[$i]))
         continue;

./Sources/ManageSearch.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$context['index_settings'] = unserialize($modSettings['search_custom_index_resume']);
Replace With: [Select]
$context['index_settings'] = safe_unserialize($modSettings['search_custom_index_resume']);

./Sources/ManageServer.php
Operation #1
Find: [Select]
@version 2.0.10
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$context['config_vars'][$config_var[1]]['value'] = !empty($context['config_vars'][$config_var[1]]['value']) ? unserialize($context['config_vars'][$config_var[1]]['value']) : array();
Replace With: [Select]
$context['config_vars'][$config_var[1]]['value'] = !empty($context['config_vars'][$config_var[1]]['value']) ? safe_unserialize($context['config_vars'][$config_var[1]]['value']) : array();

./Sources/Memberlist.php
Operation #1
Find: [Select]
@version 2.0.8
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$memberlist_cache = @unserialize($modSettings['memberlist_cache']);
Replace With: [Select]
$memberlist_cache = safe_unserialize($modSettings['memberlist_cache']);

./Sources/ModerationCenter.php
Operation #1
Find: [Select]
@version 2.0.1
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
Replace With: [Select]
$context['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();

./Sources/Modlog.php
Operation #1
Find: [Select]
@version 2.0.11
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$row['extra'] = @unserialize($row['extra']);
Replace With: [Select]
$row['extra'] = safe_unserialize($row['extra']);

./Sources/Packages.php
Operation #1
Find: [Select]
@version 2.0.11
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$db_changes = empty($row['db_changes']) ? array() : unserialize($row['db_changes']);
Replace With: [Select]
$db_changes = empty($row['db_changes']) ? array() : safe_unserialize($row['db_changes']);

Operation #3
Find: [Select]
$theme_data = unserialize(base64_decode($change));
Replace With: [Select]
$theme_data = safe_unserialize(base64_decode($change));

Operation #4
Find: [Select]
$db_changes = empty($row['db_changes']) ? array() : unserialize($row['db_changes']);
Replace With: [Select]
$db_changes = empty($row['db_changes']) ? array() : safe_unserialize($row['db_changes']);

Operation #5
Find: [Select]
$old_db_changes = empty($row['db_changes']) ? array() : unserialize($row['db_changes']);
Replace With: [Select]
$old_db_changes = empty($row['db_changes']) ? array() : safe_unserialize($row['db_changes']);

Operation #6
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

./Sources/PersonalMessage.php
Operation #1
Find: [Select]
@version 2.0.5
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
'criteria' => unserialize($row['criteria']),
Replace With: [Select]
'criteria' => safe_unserialize($row['criteria']),

Operation #3
Find: [Select]
'actions' => unserialize($row['actions']),
Replace With: [Select]
'actions' => safe_unserialize($row['actions']),

./Sources/Post.php
Operation #1
Find: [Select]
@version 2.0.10
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #3
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

./Sources/Profile-Actions.php
Operation #1
Find: [Select]
@version 2.0.6
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$costs = @unserialize($sub['real_cost']);
Replace With: [Select]
$costs = safe_unserialize($sub['real_cost']);

Operation #3
Find: [Select]
$current_pending = @unserialize($context['current'][$_GET['sub_id']]['pending_details']);
Replace With: [Select]
$current_pending = safe_unserialize($context['current'][$_GET['sub_id']]['pending_details']);

Operation #4
Find: [Select]
$current_pending = @unserialize($context['current'][$context['sub']['id']]['pending_details']);
Replace With: [Select]
$current_pending = safe_unserialize($context['current'][$context['sub']['id']]['pending_details']);

./Sources/Profile-Modify.php
Operation #1
Find: [Select]
@version 2.0.7
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

./Sources/Profile-View.php
Operation #1
Find: [Select]
@version 2.0.5
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$extra = @unserialize($row['extra']);
Replace With: [Select]
$extra = safe_unserialize($row['extra']);

./Sources/Register.php
Operation #1
Find: [Select]
if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))
Replace With: [Select]
if ($row['mask'] == 'email' && !empty($value) && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255))

./Sources/RemoveTopic.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);
Replace With: [Select]
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

Operation #3
Find: [Select]
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);
Replace With: [Select]
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

./Sources/SearchAPI-Custom.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$this->indexSettings = unserialize($modSettings['search_custom_index_config']);
Replace With: [Select]
$this->indexSettings = safe_unserialize($modSettings['search_custom_index_config']);

./Sources/Subs-Charset.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
if (@unserialize($row['extra']) === false && preg_match('~^(a:3:{s:5:"topic";i:\d+;s:7:"subject";s:)(\d+):"(.+)"(;s:6:"member";s:5:"\d+";})$~', $row['extra'], $matches) === 1)
Replace With: [Select]
if (safe_unserialize($row['extra']) === false && preg_match('~^(a:3:{s:5:"topic";i:\d+;s:7:"subject";s:)(\d+):"(.+)"(;s:6:"member";s:5:"\d+";})$~', $row['extra'], $matches) === 1)

./Sources/Subs-Graphics.php
Operation #1
Find: [Select]
@version 2.0.9
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

./Sources/Subs-Members.php
Operation #1
Find: [Select]
@version 2.0.7
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $regOptions['email'])
Replace With: [Select]
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,15})$~', $regOptions['email'])

./Sources/Subs-MembersOnline.php
Operation #1
Find: [Select]
@version 2.0
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$spiders = unserialize($modSettings['spider_name_cache']);
Replace With: [Select]
$spiders = safe_unserialize($modSettings['spider_name_cache']);

./Sources/Subs-Menu.php
Operation #1
Find: [Select]
@version 2.0.1
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$menu_context['sections'][$section_id]['areas'][$area_id] = unserialize(base64_decode('YTozOntzOjU6ImxhYmVsIjtzOjEyOiJPb21wYSBMb29tcGEiO3M6MzoidXJsIjtzOjQzOiJodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL09vbXBhX0xvb21wYXM/IjtzOjQ6Imljb24iO3M6ODY6IjxpbWcgc3JjPSJodHRwOi8vd3d3LnNpbXBsZW1hY2hpbmVzLm9yZy9pbWFnZXMvb29tcGEuZ2lmIiBhbHQ9IkknbSBhbiBPb21wYSBMb29tcGEiIC8+Ijt9'));
Replace With: [Select]
$menu_context['sections'][$section_id]['areas'][$area_id] = safe_unserialize(base64_decode('YTozOntzOjU6ImxhYmVsIjtzOjEyOiJPb21wYSBMb29tcGEiO3M6MzoidXJsIjtzOjQzOiJodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL09vbXBhX0xvb21wYXM/IjtzOjQ6Imljb24iO3M6ODY6IjxpbWcgc3JjPSJodHRwOi8vd3d3LnNpbXBsZW1hY2hpbmVzLm9yZy9pbWFnZXMvb29tcGEuZ2lmIiBhbHQ9IkknbSBhbiBPb21wYSBMb29tcGEiIC8+Ijt9'));

./Sources/Subs-Post.php
Operation #1
Find: [Select]
@version 2.0.8
Replace With: [Select]
@version 2.0.12
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]
@version 2.0.10
Replace With: [Select]
@version 2.0.12
This operation isn't vital to the installation of this mod.

Operation #3
Find: [Select]
$criteria = unserialize($row['criteria']);
Replace With: [Select]
$criteria = safe_unserialize($row['criteria']);

Operation #4
Find: [Select]
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);
Replace With: [Select]
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

Operation #5
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #6
Find: [Select]
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);
Replace With: [Select]
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

Operation #7
Find: [Select]

   $message = preg_replace_callback('~\[nobbc\](.+?)\[/nobbc\]~is', 'nobbc__preg_callback', $message);
Replace With: [Select]

   $message = preg_replace_callback('~\[nobbc\](.+?)\[/nobbc\]~is', 'nobbc__preg_callback', $message);

   // Remove empty bbc.
   $message = preg_replace('~\[([^\]=\s]+)[^\]]*\](?' . '>\s|(?R))*?\[/\1\]\s?~i', '', $message);

./Sources/Subs.php
Operation #1
Find: [Select]
@version 2.0.11
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #3
Find: [Select]
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
Replace With: [Select]
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Operation #4
Find: [Select]
function safe_unserialize($data)
{
   // There's no reason input should contain an object,
   // user is up to no good...
   if (preg_match('/(^|;|{|})O:([0-9]|\+|\-)+/', $data) === 0)
      return @unserialize($data);
}
Replace With: [Select]
/**
 * Safe serialize() and unserialize() replacements
 *
 * @license Public Domain
 *
 * @author anthon (dot) pang (at) gmail (dot) com
 */

/**
 * Safe serialize() replacement. Recursive
 * - output a strict subset of PHP's native serialized representation
 * - does not serialize objects
 *
 * @param mixed $value
 * @return string
 */
function _safe_serialize($value)
{
   if(is_null($value))
      return 'N;';

   if(is_bool($value))
      return 'b:'. (int) $value .';';

   if(is_int($value))
      return 'i:'. $value .';';

   if(is_float($value))
      return 'd:'. str_replace(',', '.', $value) .';';

   if(is_string($value))
      return 's:'. strlen($value) .':"'. $value .'";';

   if(is_array($value))
   {
      $out = '';
      foreach($value as $k => $v)
         $out .= _safe_serialize($k) . _safe_serialize($v);

      return 'a:'. count($value) .':{'. $out .'}';
   }

   // safe_serialize cannot serialize resources or objects.
   return false;
}
/**
 * Wrapper for _safe_serialize() that handles exceptions and multibyte encoding issues.
 *
 * @param mixed $value
 * @return string
 */
function safe_serialize($value)
{
   // Make sure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
   if (function_exists('mb_internal_encoding') &&
      (((int) ini_get('mbstring.func_overload')) & 2))
   {
      $mbIntEnc = mb_internal_encoding();
      mb_internal_encoding('ASCII');
   }

   $out = _safe_serialize($value);

   if (isset($mbIntEnc))
      mb_internal_encoding($mbIntEnc);

   return $out;
}

/**
 * Safe unserialize() replacement
 * - accepts a strict subset of PHP's native serialized representation
 * - does not unserialize objects
 *
 * @param string $str
 * @return mixed
 * @throw Exception if $str is malformed or contains unsupported types (e.g., resources, objects)
 */
function _safe_unserialize($str)
{
   // Input exceeds 4096.
   if(strlen($str) > 4096)
      return false;

   // Input  is not a string.
   if(empty($str) || !is_string($str))
      return false;

   $stack = array();
   $expected = array();

   /*
    * states:
    *   0 - initial state, expecting a single value or array
    *   1 - terminal state
    *   2 - in array, expecting end of array or a key
    *   3 - in array, expecting value or another array
    */
   $state = 0;
   while($state != 1)
   {
      $type = isset($str[0]) ? $str[0] : '';
      if($type == '}')
         $str = substr($str, 1);

      else if($type == 'N' && $str[1] == ';')
      {
         $value = null;
         $str = substr($str, 2);
      }
      else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))
      {
         $value = $matches[1] == '1' ? true : false;
         $str = substr($str, 4);
      }
      else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))
      {
         $value = (int)$matches[1];
         $str = $matches[2];
      }
      else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))
      {
         $value = (float)$matches[1];
         $str = $matches[3];
      }
      else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";')
      {
         $value = substr($matches[2], 0, (int)$matches[1]);
         $str = substr($matches[2], (int)$matches[1] + 2);
      }
      else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches) && $matches[1] < 256)
      {
         $expectedLength = (int)$matches[1];
         $str = $matches[2];
      }

      // Object or unknown/malformed type.
      else
         return false;

      switch($state)
      {
         case 3: // In array, expecting value or another array.
            if($type == 'a')
            {
               // Array nesting exceeds 3.
               if(count($stack) >= 3)
                  return false;

               $stack[] = &$list;
               $list[$key] = array();
               $list = &$list[$key];
               $expected[] = $expectedLength;
               $state = 2;
               break;
            }
            if($type != '}')
            {
               $list[$key] = $value;
               $state = 2;
               break;
            }

            // Missing array value.
            return false;

         case 2: // in array, expecting end of array or a key
            if($type == '}')
            {
               // Array size is less than expected.
               if(count($list) < end($expected))
                  return false;

               unset($list);
               $list = &$stack[count($stack)-1];
               array_pop($stack);

               // Go to terminal state if we're at the end of the root array.
               array_pop($expected);

               if(count($expected) == 0)
                  $state = 1;

               break;
            }

            if($type == 'i' || $type == 's')
            {
               // Array size exceeds 256.
               if(count($list) >= 256)
                  return false;

               // Array size exceeds expected length.
               if(count($list) >= end($expected))
                  return false;

               $key = $value;
               $state = 3;
               break;
            }

            // Illegal array index type.
            return false;

         // Expecting array or value.
         case 0:
            if($type == 'a')
            {
               // Array nesting exceeds 3.
               if(count($stack) >= 3)
                  return false;

               $data = array();
               $list = &$data;
               $expected[] = $expectedLength;
               $state = 2;
               break;
            }

            if($type != '}')
            {
               $data = $value;
               $state = 1;
               break;
            }

            // Not in array.
            return false;
      }
   }

   // Trailing data in input.
   if(!empty($str))
      return false;

   return $data;
}

/**
 * Wrapper for _safe_unserialize() that handles exceptions and multibyte encoding issue
 *
 * @param string $str
 * @return mixed
 */
function safe_unserialize($str)
{
   // Make sure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
   if (function_exists('mb_internal_encoding') &&
      (((int) ini_get('mbstring.func_overload')) & 0x02))
   {
      $mbIntEnc = mb_internal_encoding();
      mb_internal_encoding('ASCII');
   }

   $out = _safe_unserialize($str);

   if (isset($mbIntEnc))
      mb_internal_encoding($mbIntEnc);

   return $out;
}

./Sources/Subscriptions-PayPal.php
Operation #1
Find: [Select]
if (function_exists('curl_init') && $curl = curl_init((!empty($modSettings['paidsubs_test']) ? 'https://www.sandbox.' : 'http://www.') . 'paypal.com/cgi-bin/webscr'))
Replace With: [Select]
      if (function_exists('curl_init') && $curl = curl_init((!empty($modSettings['paidsubs_test']) ? 'https://www.sandbox.' : 'https://www.') . 'paypal.com/cgi-bin/webscr'))

Operation #2
Find: [Select]
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
Replace With: [Select]
$fp = fsockopen('ssl://www.paypal.com', 443, $errno, $errstr, 30);

./Sources/Themes.php
Operation #1
Find: [Select]
@version 2.0.4
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$install_info += unserialize($match[1]);
Replace With: [Select]
$install_info += safe_unserialize($match[1]);

Operation #3
Find: [Select]
$options['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
Replace With: [Select]
$options['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();

Operation #4
Find: [Select]
updateMemberData((int) $_REQUEST['u'], array('id_theme' => (int) $_GET['th']));
Replace With: [Select]
if (isset($_GET['th']) && $_GET['th'] == 0)
            $_GET['th'] = $modSettings['theme_guests'];

         updateMemberData((int) $_REQUEST['u'], array('id_theme' => (int) $_GET['th']));

./Sources/Who.php
Operation #1
Find: [Select]
@version 2.0.2
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$actions = @unserialize($row['url']);
Replace With: [Select]
$actions = safe_unserialize($row['url']);

Operation #3
Find: [Select]
foreach (unserialize($modSettings['spider_name_cache']) as $id => $name)
Replace With: [Select]
foreach (safe_unserialize($modSettings['spider_name_cache']) as $id => $name)

Operation #4
Find: [Select]
$actions = @unserialize($url[0]);
Replace With: [Select]
$actions = safe_unserialize($url[0]);

./subscriptions.php
Operation #1
Find: [Select]
@version 2.0.2
Replace With: [Select]
@version 2.0.12

Operation #2
Find: [Select]
$cost = unserialize($subscription_info['cost']);
Replace With: [Select]
$cost = safe_unserialize($subscription_info['cost']);

Operation #3
Find: [Select]
$real_details = @unserialize($subscription_info['pending_details']);
Replace With: [Select]
$real_details = safe_unserialize($subscription_info['pending_details']);

./Themes/default/scripts/editor.js
Operation #1
Find: [Select]
         oMyStyle.styleSheet.cssText = document.styleSheets['editor_ie_css'] ? document.styleSheets['editor_ie_css'].cssText : document.styleSheets['editor_css'].cssText;
Replace With: [Select]

         if (oMyStyle.styleSheet)
            oMyStyle.styleSheet.cssText = document.styleSheets['editor_ie_css'] ? document.styleSheets['editor_ie_css'].cssText : document.styleSheets['editor_css'].cssText;
         else
            oMyStyle.sheet.cssText = document.styleSheets['editor_ie_css'] ? document.styleSheets['editor_ie_css'].cssText : document.styleSheets['editor_css'].cssText;

Operation #2
Find: [Select]
this.oSmileyPopupWindow = window.open('about:blank', this.opt.sUniqueId + '_addMoreSmileysPopup', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=480,height=220,resizable=yes');
Replace With: [Select]
this.oSmileyPopupWindow = window.open('', this.opt.sUniqueId + '_addMoreSmileysPopup', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=480,height=220,resizable=yes');

Operation #3
Find: [Select]
this.bRichTextPossible = !this.opt.bRichEditOff && ((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome) && !(is_iphone || is_android);
Replace With: [Select]
this.bRichTextPossible = !this.opt.bRichEditOff && ((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome);

./Themes/default/Themes.template.php
Operation #1
Find: [Select]
@version 2.0.7
Replace With: [Select]
@version 2.0.12
This operation isn't vital to the installation of this mod.

Operation #2
Find: [Select]
<a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $theme['name'], '</a>
Replace With: [Select]
<a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $theme['name'], (!empty($theme['variants']) ? ';vrt=' . $theme['selected_variant'] : ''), '</a>

Operation #3
Find: [Select]
                  <li>
                     <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '" id="theme_use_', $theme['id'], '">[', $txt['theme_set'], ']</a>
                  </li>
                  <li>
                     <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';theme=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '" id="theme_preview_', $theme['id'], '">[', $txt['theme_preview'], ']</a>
                  </li>
Replace With: [Select]
                  <li>
                     <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], (!empty($theme['variants']) ? ';vrt=' . $theme['selected_variant'] : ''), '" id="theme_use_', $theme['id'], '">[', $txt['theme_set'], ']</a>
                  </li>
                  <li>
                     <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';theme=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'],  (!empty($theme['variants']) ? ';vrt=' . $theme['selected_variant'] : ''), '" id="theme_preview_', $theme['id'], '">[', $txt['theme_preview'], ']</a>
                  </li>


 
Share this topic...
In a forum
(BBCode)
In a site/blog
(HTML)


Related Topics

  Subject / Started by Replies Last post
1 Replies
16562 Views
Last post June 29, 2011, 10:01:42 AM
by ll3lack
0 Replies
3169 Views
Last post February 04, 2012, 08:41:13 AM
by Nick
0 Replies
13613 Views
Last post December 21, 2012, 02:09:35 PM
by Nick
0 Replies
12498 Views
Last post October 29, 2013, 12:55:42 PM
by Nick
0 Replies
2352 Views
Last post January 31, 2014, 01:26:25 PM
by Nick
0 Replies
2322 Views
Last post October 18, 2014, 12:44:11 AM
by tsunami09
67 Replies
12440 Views
Last post March 26, 2015, 12:51:25 PM
by sandeejung
0 Replies
2390 Views
Last post August 05, 2016, 01:30:41 PM
by Nick
0 Replies
6471 Views
Last post March 03, 2017, 03:28:41 PM
by Nick
0 Replies
14039 Views
Last post November 29, 2017, 01:57:11 PM
by Nick