From 4758d49b9b661703d2cd5cffaa9c6c443a624e1d Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 14 Jun 2009 10:53:08 +0000 Subject: [PATCH] view_log() breaks if the serialized data is corrupt. #46545 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9589 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_admin.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index fa05dbf1b3..8be9b27f20 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -104,6 +104,7 @@
  • [Fix] Allow friends/foes to be added and removed at the same time. (Bug #46255 - Patch by bantu)
  • [Fix] Only change topic/post icon if icons are enabled and user is allowed to. (Bug #46355 - Patch by bantu)
  • [Fix] Fix saving custom profile fields in ACP if Oracle used (Bug #46015)
  • +
  • [Fix] Make view_log() more resilient to corrupt serialized data. (Bug #46545)
  • [Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
  • [Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)
  • [Change] Template engine now permits to a limited extent variable includes.
  • diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index a1f34792e0..a8e49a12bc 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2419,7 +2419,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id if (!empty($row['log_data'])) { - $log_data_ary = unserialize($row['log_data']); + $log_data_ary = @unserialize($row['log_data']); + $log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary; if (isset($user->lang[$row['log_operation']])) { @@ -2442,7 +2443,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id $log[$i]['action'] = bbcode_nl2br(censor_text($log[$i]['action'])); } } - else + else if (!empty($log_data_ary)) { $log[$i]['action'] .= '
    ' . implode('', $log_data_ary); }