Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Compose.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ public function buildAndSendMessage(
$headers->addUserAgentHeader();

/* Add preferred reply language(s). */
if ($lang = @unserialize($prefs->getValue('reply_lang'))) {
if ($lang = @unserialize($prefs->getValue('reply_lang'), array('allowed_classes' => false))) {
$headers->addHeader('Accept-Language', implode(',', $lang));
}

Expand Down
7 changes: 6 additions & 1 deletion lib/Factory/MailboxList.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ public function create($mailbox)
$mailbox = IMP_Mailbox::get($mailbox);

if ($ob = $this->_getCache($mailbox)->get($key)) {
$ob = @unserialize($ob);
$ob = @unserialize($ob, array('allowed_classes' => array(
'IMP_Mailbox_List_Virtual',
'IMP_Mailbox_List_Pop3',
'IMP_Mailbox_List',
'IMP_Mailbox',
)));
}

if (!$ob) {
Expand Down
23 changes: 22 additions & 1 deletion lib/Flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,28 @@ public function __construct()
}

if ($f_list = $GLOBALS['prefs']->getValue('msgflags')) {
$f_list = @unserialize($f_list);
$f_list = @unserialize($f_list, array('allowed_classes' => array(
'IMP_Flag_Imap_Answered',
'IMP_Flag_Imap_Deleted',
'IMP_Flag_Imap_Draft',
'IMP_Flag_Imap_Flagged',
'IMP_Flag_Imap_Forwarded',
'IMP_Flag_Imap_Junk',
'IMP_Flag_Imap_NotJunk',
'IMP_Flag_Imap_Seen',
'IMP_Flag_System_Attachment',
'IMP_Flag_System_Encrypted',
'IMP_Flag_System_HighPriority',
'IMP_Flag_System_List',
'IMP_Flag_System_LowPriority',
'IMP_Flag_System_Personal',
'IMP_Flag_System_Signed',
'IMP_Flag_System_Unseen',
'IMP_Flag_System_Match_Address',
'IMP_Flag_System_Match_Flag',
'IMP_Flag_System_Match_Header',
'IMP_Flag_User',
)));
if (is_array($f_list)) {
foreach ($f_list as $val) {
$this->_userflags[$val->id] = $val;
Expand Down
2 changes: 1 addition & 1 deletion lib/Ftree/Prefs/Expanded.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct()
{
global $prefs;

if (($folders = @unserialize($prefs->getValue('expanded_folders'))) &&
if (($folders = @unserialize($prefs->getValue('expanded_folders'), array('allowed_classes' => false))) &&
is_array($folders)) {
$this->_data = $folders;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Ftree/Prefs/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(IMP_Ftree $ftree)
$this->_data = array('INBOX' => 1);

/* Add the list of polled mailboxes from the prefs. */
if ($nav_poll = @unserialize($prefs->getValue('nav_poll'))) {
if ($nav_poll = @unserialize($prefs->getValue('nav_poll'), array('allowed_classes' => false))) {
$this->_data += $nav_poll;
}

Expand Down
7 changes: 5 additions & 2 deletions lib/LoginTasks/SystemTask/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ protected function _upgradeVirtualFolders()

$vfolders = $prefs->getValue('vfolder');
if (!empty($vfolders)) {
$vfolders = @unserialize($vfolders);
$vfolders = @unserialize($vfolders, array('allowed_classes' => array(
'IMP_Search_Vfolder_Vinbox',
'IMP_Search_Vfolder_Vtrash',
)));
}

if (empty($vfolders) || !is_array($vfolders)) {
Expand Down Expand Up @@ -573,7 +576,7 @@ protected function _upgradeStationeryToTemplates()
{
global $injector, $prefs;

$slist = @unserialize($prefs->getValue('stationery'));
$slist = @unserialize($prefs->getValue('stationery'), array('allowed_classes' => false));
if (is_array($slist)) {
/* Old entry format:
* 'c' => (string) Content
Expand Down
2 changes: 1 addition & 1 deletion lib/Prefs/Sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct()
{
global $prefs;

$sortpref = @unserialize($prefs->getValue(self::SORTPREF));
$sortpref = @unserialize($prefs->getValue(self::SORTPREF), array('allowed_classes' => false));
if (is_array($sortpref)) {
$this->_sortpref = $sortpref;
}
Expand Down
4 changes: 3 additions & 1 deletion lib/Remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class IMP_Remote implements ArrayAccess, IteratorAggregate
*/
public function __construct()
{
$this->_accounts = @unserialize($GLOBALS['prefs']->getValue('remote')) ?: array();
$this->_accounts = @unserialize($GLOBALS['prefs']->getValue('remote'), array('allowed_classes' => array(
'IMP_Remote_Account',
))) ?: array();
}

/**
Expand Down
15 changes: 13 additions & 2 deletions lib/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,15 @@ class_exists($cname)) {
}

if ($f_list = $GLOBALS['prefs']->getValue('filter')) {
$f_list = @unserialize($f_list);
$f_list = @unserialize($f_list, array('allowed_classes' => array(
'IMP_Search_Filter',
'IMP_Search_Filter_Personal',
'IMP_Search_Filter_Attachment',
'IMP_Search_Filter_Autogenerated',
'IMP_Search_Filter_Contacts',
'IMP_Search_Filter_Bulk',
'IMP_Search_Filter_Mailinglist',
)));
if (is_array($f_list)) {
foreach ($f_list as $val) {
if ($val instanceof IMP_Search_Filter) {
Expand Down Expand Up @@ -297,7 +305,10 @@ class_exists($cname)) {
}

if ($pref_vf = $GLOBALS['prefs']->getValue('vfolder')) {
$pref_vf = @unserialize($pref_vf);
$pref_vf = @unserialize($pref_vf, array('allowed_classes' => array(
'IMP_Search_Vfolder_Vinbox',
'IMP_Search_Vfolder_Vtrash',
)));
if (is_array($pref_vf)) {
foreach ($pref_vf as $val) {
if ($val instanceof IMP_Search_Vfolder) {
Expand Down