SMF 2.0.11 para SMF 2.0.12

Started by candidosa2, 06 de October de 2016, 21:59

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Go Down

candidosa2

06 de October de 2016, 21:59 Last Edit: 06 de October de 2016, 23:36 by candidosa2
Leia-me

Este patch irá fornecer importantes correções de segurança e bugs no seu 2.0.11 fórum.

changelog
=========
- Injecção de censor palavra fixo, não permitindo uma "palavra apropriada" vazio
- Corrigido unserialize vulneráveis ​​() código, convertendo todas as instâncias para safe_unserialize ()
- Adicionado um safe_unserialize mais completa () para impedir a injeção de objeto
- Corrigido o erro onde deixando um campo de perfil personalizado em branco no registro que tem uma máscara de e-mail iria lançar um erro
- Integração PayPal fixo para cumprir com a sua nova política SSL forçado
- Corrigido o erro onde as notificações foram enviadas para mensagens em placas inacessíveis
- Editor Fixo para fazer o trabalho de editor com o Microsoft Borda
- Corrigido problema onde a janela pop-up do smiley está em branco no iOS 9 dispositivos
- Corrigido editor WYSIWYG em dispositivos móveis
- Corrigido um $ _ POST [ 'icon'] indefinido em Fontes / post.php
- Corrigido um pequeno bug no Login2 ()
- Corrigido um problema onde SMF não reconhece novos nomes de domínio e considera estes como inválida
- Corrigido um problema onde SMF permitiria BBC vazia
- Corrigido um problema onde variantes do tema não poderia ser selecionada
- Corrigido um problema onde a versão do Subs-Post.php arquivo poderia ter sido 2.0.8 ou 2.0.11. Ele será atualizado para 2.0.12 em ambos os casos.

Edições de ficheiro

./index.php

Code Select
* @version 2.0.11

Code Select
* @version 2.0.12

Code Select
$forum_version = 'SMF 2.0.11';

Code Select
$forum_version = 'SMF 2.0.12';


./Themes/default/languages/index.english.php

Code Select
// Version: 2.0.10; index

Code Select
// Version: 2.0.12; index

Esta operação não é vital para a instalação deste mod.

Code 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>';

Code 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>';




./Themes/default/languages/index.english-utf8.php

Code Select
// Version: 2.0.10; índex

Code Select
// Version: 2.0.12; index

Code 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>';

Code 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>';


./Sources/Admin.php

Code Select
@version 2.0

Code Select
@version 2.0.12

Code Select
$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();

Code Select
$context['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();


./Sources/Calendar.php

Code Select
@version 2.0

Code Select
@version 2.0.11

Code Select
$context['clockicons'] = unserialize(base64_decode('YTo2OntzOjI6ImgxIjthOjI6e2k6MDtpOjI7aToxO2k6MTt9czoyOiJoMiI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjI6Im0xIjthOjM6e2k6MDtpOjQ7aToxO2k6MjtpOjI7aToxO31zOjI6Im0yIjthOjQ6e2k6MDtpOjg7aToxO2k6NDtpOjI7aToyO2k6MztpOjE7fXM6MjoiczEiO2E6Mzp7aTowO2k6NDtpOjE7aToyO2k6MjtpOjE7fXM6MjoiczIiO2E6NDp7aTowO2k6ODtpOjE7aTo0O2k6MjtpOjI7aTozO2k6MTt9fQ=='));

Code Select
$context['clockicons'] = safe_unserialize(base64_decode('YTo2OntzOjI6ImgxIjthOjI6e2k6MDtpOjI7aToxO2k6MTt9czoyOiJoMiI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjI6Im0xIjthOjM6e2k6MDtpOjQ7aToxO2k6MjtpOjI7aToxO31zOjI6Im0yIjthOjQ6e2k6MDtpOjg7aToxO2k6NDtpOjI7aToyO2k6MztpOjE7fXM6MjoiczEiO2E6Mzp7aTowO2k6NDtpOjE7aToyO2k6MjtpOjE7fXM6MjoiczIiO2E6NDp7aTowO2k6ODtpOjE7aTo0O2k6MjtpOjI7aTozO2k6MTt9fQ=='));

Code Select
$context['clockicons'] = unserialize(base64_decode('YTozOntzOjE6ImgiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czoxOiJtIjthOjY6e2k6MDtpOjMyO2k6MTtpOjE2O2k6MjtpOjg7aTozO2k6NDtpOjQ7aToyO2k6NTtpOjE7fXM6MToicyI7YTo2OntpOjA7aTozMjtpOjE7aToxNjtpOjI7aTo4O2k6MztpOjQ7aTo0O2k6MjtpOjU7aToxO319'));

Code Select
$context['clockicons'] = safe_unserialize(base64_decode('YTozOntzOjE6ImgiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czoxOiJtIjthOjY6e2k6MDtpOjMyO2k6MTtpOjE2O2k6MjtpOjg7aTozO2k6NDtpOjQ7aToyO2k6NTtpOjE7fXM6MToicyI7YTo2OntpOjA7aTozMjtpOjE7aToxNjtpOjI7aTo4O2k6MztpOjQ7aTo0O2k6MjtpOjU7aToxO319'));

Code Select
$context['clockicons'] = unserialize(base64_decode('YTo2OntzOjQ6InllYXIiO2E6Nzp7aTowO2k6NjQ7aToxO2k6MzI7aToyO2k6MTY7aTozO2k6ODtpOjQ7aTo0O2k6NTtpOjI7aTo2O2k6MTt9czo1OiJtb250aCI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjM6ImRheSI7YTo1OntpOjA7aToxNjtpOjE7aTo4O2k6MjtpOjQ7aTozO2k6MjtpOjQ7aToxO31zOjQ6ImhvdXIiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czozOiJtaW4iO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9czozOiJzZWMiO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9fQ=='));

Code Select
$context['clockicons'] = safe_unserialize(base64_decode('YTo2OntzOjQ6InllYXIiO2E6Nzp7aTowO2k6NjQ7aToxO2k6MzI7aToyO2k6MTY7aTozO2k6ODtpOjQ7aTo0O2k6NTtpOjI7aTo2O2k6MTt9czo1OiJtb250aCI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjM6ImRheSI7YTo1OntpOjA7aToxNjtpOjE7aTo4O2k6MjtpOjQ7aTozO2k6MjtpOjQ7aToxO31zOjQ6ImhvdXIiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czozOiJtaW4iO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9czozOiJzZWMiO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9fQ=='));


./Sources/DbPackages-mysql.php


Code Select
@version 2.0

Code Select
@version 2.0.12

Code Select
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column['unsigned']) ? 'unsigned ' : '';

Code Select
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

Code Select
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

Code Select
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

Code Select
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

Code Select
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint', 'float')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';


./Sources/Display.php

Code Select
@version 2.0.9

Code Select
@version 2.0.11

Code Select
$modSettings['attachmentUploadDir'] = @unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);


./Sources/Load.php

Code Select
@version 2.0.11

Code Select
@version 2.0.12

Code Select
$integration_settings = unserialize(SMF_INTEGRATION_SETTINGS);

Code Select
$integration_settings = safe_unserialize(SMF_INTEGRATION_SETTINGS);

Code Select
$context['display_fields'] = unserialize($modSettings['displayFields']);

Code Select
$context['display_fields'] = safe_unserialize($modSettings['displayFields']);

Code Select
return @unserialize($value);

Code Select
return safe_unserialize($value);


./Sources/LogInOut.php


Code Select
@version 2.0.11

Code Select
@version 2.0.12

Code Select
elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 || $_POST['cookielength'] <= 525600))

Code Select
elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 && $_POST['cookielength'] <= 525600))


./Sources/ManageAttachments.php


Code Select
@version 2.0.10

Code Select
@version 2.0.12

Code Select
$attach_dirs = unserialize($modSettings['attachmentUploadDir']);

Code Select
$attach_dirs = safe_unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);


./Sources/ManagePaid.php

Code Select
@version 2.0.3

Code Select
@version 2.0.12

Code Select
'cost' => @unserialize($row['cost']),

Code Select
'cost' => safe_unserialize($row['cost']),

Code Select
$pending_details = @unserialize($row['pending_details']);

Code Select
$pending_details = safe_unserialize($row['pending_details']);

Code Select
$costs = @unserialize($context['current_subscription']['real_cost']);

Code Select
$costs = safe_unserialize($context['current_subscription']['real_cost']);

Code Select
$costs = @unserialize($row['cost']);

Code Select
$costs = safe_unserialize($row['cost']);


./Sources/ManagePosts.php

Code Select
if (empty($censor_vulgar[$i]))
continue;


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




./Sources/ManageSearch.php


Code Select
@version 2.0

Code Select
@version 2.0.12

Code Select
$context['index_settings'] = unserialize($modSettings['search_custom_index_resume']);

Code Select
$context['index_settings'] = safe_unserialize($modSettings['search_custom_index_resume']);


./Sources/ManageServer.php


Code Select
@version 2.0.10

Code Select
@version 2.0.12

Code 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();

Code 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

Code Select
@version 2.0.8

Code Select
@version 2.0.12

Code Select
$memberlist_cache = @unserialize($modSettings['memberlist_cache']);

Code Select
$memberlist_cache = safe_unserialize($modSettings['memberlist_cache']);


./Sources/ModerationCenter.php


Code Select
@version 2.0.1

Code Select
@version 2.0.12

Code Select
$context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();

Code Select
$context['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();


./Sources/Modlog.php

Code Select
@version 2.0.11

Code Select
@version 2.0.12

Code Select
$row['extra'] = @unserialize($row['extra']);

Code Select
$row['extra'] = safe_unserialize($row['extra']);


./Sources/Packages.php


Code Select
@version 2.0.11

Code Select
@version 2.0.12

Code Select
$db_changes = empty($row['db_changes']) ? array() : unserialize($row['db_changes']);

Code Select
$db_changes = empty($row['db_changes']) ? array() : safe_unserialize($row['db_changes']);

Code Select
$theme_data = unserialize(base64_decode($change));

Code Select
$theme_data = safe_unserialize(base64_decode($change));

Code Select
$db_changes = empty($row['db_changes']) ? array() : unserialize($row['db_changes']);

Code Select
$db_changes = empty($row['db_changes']) ? array() : safe_unserialize($row['db_changes']);

Code Select
$old_db_changes = empty($row['db_changes']) ? array() : unserialize($row['db_changes']);

Code Select
$old_db_changes = empty($row['db_changes']) ? array() : safe_unserialize($row['db_changes']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);


./Sources/PersonalMessage.php


Code Select
@version 2.0.5

Code Select
@version 2.0.12

Code Select
'criteria' => unserialize($row['criteria']),

Code Select
'criteria' => safe_unserialize($row['criteria']),

Code Select
'actions' => unserialize($row['actions']),

Code Select
'actions' => safe_unserialize($row['actions']),


./Sources/Post.php


Code Select
@version 2.0.10

Code Select
@version 2.0.12

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);


./Sources/Profile-Actions.php


Code Select
@version 2.0.6

Code Select
@version 2.0.12

Code Select
$costs = @unserialize($sub['real_cost']);

Code Select
$costs = safe_unserialize($sub['real_cost']);

Code Select
$current_pending = @unserialize($context['current'][$_GET['sub_id']]['pending_details']);

Code Select
$current_pending = safe_unserialize($context['current'][$_GET['sub_id']]['pending_details']);

Code Select
$current_pending = @unserialize($context['current'][$context['sub']['id']]['pending_details']);

Code Select
$current_pending = safe_unserialize($context['current'][$context['sub']['id']]['pending_details']);


./Sources/Profile-Modify.php

Code Select
@version 2.0.7

Code Select
@version 2.0.12

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);


./Sources/Profile-View.php


Code Select
@version 2.0.5

Code Select
@version 2.0.12

Code Select
$extra = @unserialize($row['extra']);

Code Select
$extra = safe_unserialize($row['extra']);


./Sources/Register.php


Code 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))

Code 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

Code Select
@version 2.0

Code Select
@version 2.0.12

Code Select
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);

Code Select
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

Code Select
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);

Code Select
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);


./Sources/SearchAPI-Custom.php


Code Select
@version 2.0

Code Select
@version 2.0.12

Code Select
$this->indexSettings = unserialize($modSettings['search_custom_index_config']);

Code Select
$this->indexSettings = safe_unserialize($modSettings['search_custom_index_config']);



./Sources/Subs-Charset.php


Code Select
@version 2.0

Code Select
@version 2.0.12

Code 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)

Code 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


Code Select
@version 2.0.9

Code Select
@version 2.0.12

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);


./Sources/Subs-Members.php


Code Select
@version 2.0.7

Code Select
@version 2.0.12

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

Code 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


Code Select
@version 2.0

Code Select
@version 2.0.12

Code Select
$spiders = unserialize($modSettings['spider_name_cache']);

Code Select
$spiders = safe_unserialize($modSettings['spider_name_cache']);


./Sources/Subs-Menu.php


Code Select
@version 2.0.1

Code Select
@version 2.0.12

Code Select
$menu_context['sections'][$section_id]['areas'][$area_id] = unserialize(base64_decode('YTozOntzOjU6ImxhYmVsIjtzOjEyOiJPb21wYSBMb29tcGEiO3M6MzoidXJsIjtzOjQzOiJodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL09vbXBhX0xvb21wYXM/IjtzOjQ6Imljb24iO3M6ODY6IjxpbWcgc3JjPSJodHRwOi8vd3d3LnNpbXBsZW1hY2hpbmVzLm9yZy9pbWFnZXMvb29tcGEuZ2lmIiBhbHQ9IkknbSBhbiBPb21wYSBMb29tcGEiIC8+Ijt9'));

Code Select
$menu_context['sections'][$section_id]['areas'][$area_id] = safe_unserialize(base64_decode('YTozOntzOjU6ImxhYmVsIjtzOjEyOiJPb21wYSBMb29tcGEiO3M6MzoidXJsIjtzOjQzOiJodHRwOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL09vbXBhX0xvb21wYXM/IjtzOjQ6Imljb24iO3M6ODY6IjxpbWcgc3JjPSJodHRwOi8vd3d3LnNpbXBsZW1hY2hpbmVzLm9yZy9pbWFnZXMvb29tcGEuZ2lmIiBhbHQ9IkknbSBhbiBPb21wYSBMb29tcGEiIC8+Ijt9'));



./Sources/Subs-Post.php


Code Select
@version 2.0.8

Code Select
@version 2.0.12

Code Select
@version 2.0.10

Code Select
@version 2.0.12

Code Select
$criteria = unserialize($row['criteria']);

Code Select
$criteria = safe_unserialize($row['criteria']);

Code Select
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);

Code Select
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Code Select
$customIndexSettings = unserialize($modSettings['search_custom_index_config']);

Code Select
$customIndexSettings = safe_unserialize($modSettings['search_custom_index_config']);

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

Code 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

Code Select
@version 2.0.11

Code Select
@version 2.0.12

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);

Code Select
$modSettings['attachmentUploadDir'] = safe_unserialize($modSettings['attachmentUploadDir']);

Code 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);
}



Code 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

Code Select
if (function_exists('curl_init') && $curl = curl_init((!empty($modSettings['paidsubs_test']) ? 'https://www.sandbox.' : 'http://www.') . 'paypal.com/cgi-bin/webscr'))

      
Code Select
if (function_exists('curl_init') && $curl = curl_init((!empty($modSettings['paidsubs_test']) ? 'https://www.sandbox.' : 'https://www.') . 'paypal.com/cgi-bin/webscr'))

Code Select
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);

Code Select
$fp = fsockopen('ssl://www.paypal.com', 443, $errno, $errstr, 30);


./Sources/Themes.php


Code Select
@version 2.0.4

Code Select
@version 2.0.12

Code Select
$install_info += unserialize($match[1]);

Code Select
$install_info += safe_unserialize($match[1]);

Code Select
$options['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();

Code Select
$options['admin_preferences'] = !empty($options['admin_preferences']) ? safe_unserialize($options['admin_preferences']) : array();

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

Code 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

Code Select
@version 2.0.2

Code Select
@version 2.0.12

Code Select
$actions = @unserialize($row['url']);

Code Select
$actions = safe_unserialize($row['url']);

Code Select
foreach (unserialize($modSettings['spider_name_cache']) as $id => $name)

Code Select
foreach (safe_unserialize($modSettings['spider_name_cache']) as $id => $name)

Code Select
$actions = @unserialize($url[0]);

Code Select
$actions = safe_unserialize($url[0]);


./subscriptions.php


Code Select
@version 2.0.2

Code Select
@version 2.0.12

Code Select
$cost = unserialize($subscription_info['cost']);

Code Select
$cost = safe_unserialize($subscription_info['cost']);

Code Select
$real_details = @unserialize($subscription_info['pending_details']);

Code Select
$real_details = safe_unserialize($subscription_info['pending_details']);


./Themes/default/scripts/editor.js



         
Code Select
oMyStyle.styleSheet.cssText = document.styleSheets['editor_ie_css'] ? document.styleSheets['editor_ie_css'].cssText : document.styleSheets['editor_css'].cssText;


         
Code 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;


Code 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');

Code 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');


Code Select
this.bRichTextPossible = !this.opt.bRichEditOff && ((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome) && !(is_iphone || is_android);

Code Select
this.bRichTextPossible = !this.opt.bRichEditOff && ((is_ie5up && !is_ie50) || is_ff || is_opera95up || is_safari || is_chrome);


./Themes/default/Themes.template.php

Code Select
@version 2.0.7

Code Select
@version 2.0.12

Code Select
<a href="', $scripturl, '?action=theme;sa=pick;u=', $context['current_member'], ';th=', $theme['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $theme['name'], '</a>


Code 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>


                  
Code 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>



                  
Code 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>

Go Up