diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 923f5da7ef..4de5d75c75 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -644,7 +644,7 @@ if( !empty($mode) ) include($phpbb_root_path . "includes/prune.$phpEx"); - prune($from_id, 0); // Delete everything from forum + prune($from_id, 0, true); // Delete everything from forum } else { diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 10e5fbc809..7331101ea7 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -115,6 +115,8 @@ h3 {font-size:12pt;color:blue}
  • Fixed non-updating of user rank when changing from special to normal rank in rank admin
  • Changed user topic notification default in schemas to 0 (off)
  • Fixed non-XHTML compliant img tags in privmsg.php
  • +
  • Fixed non-deletion of announcements and polls when removing forum contents in forum admin
  • +
  • diff --git a/phpBB/includes/prune.php b/phpBB/includes/prune.php index 1d2f17e57d..c9cb6fe4c6 100644 --- a/phpBB/includes/prune.php +++ b/phpBB/includes/prune.php @@ -27,18 +27,18 @@ if ( !defined('IN_PHPBB') ) require($phpbb_root_path . 'includes/functions_search.'.$phpEx); -function prune($forum_id, $prune_date) +function prune($forum_id, $prune_date, $prune_all = false;) { global $db, $lang; + $prune_all = ($prune_all) ? '' : 'AND t.topic_vote = 0 AND t.topic_type <> ' . POST_ANNOUNCE; // - // Those without polls ... + // Those without polls and announcements ... unless told otherwise! // $sql = "SELECT t.topic_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t WHERE t.forum_id = $forum_id - AND t.topic_vote = 0 - AND t.topic_type <> " . POST_ANNOUNCE . " + $prune_all AND ( p.post_id = t.topic_last_post_id OR t.topic_last_post_id = 0 )"; if ( $prune_date != '' ) diff --git a/phpBB/includes/usercp_avatar.php b/phpBB/includes/usercp_avatar.php index b8d3da2a4b..7f7dc30ccd 100644 --- a/phpBB/includes/usercp_avatar.php +++ b/phpBB/includes/usercp_avatar.php @@ -83,7 +83,7 @@ function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename) $avatar_filename = 'http://' . $avatar_filename; } - if ( !preg_match('#^((http)|(ftp):\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)+[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $avatar_filename) ) + if ( !preg_match('#^((http)|(ftp):\/\/[\w\-]+?\.([\w\-]+\.)+[\w]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $avatar_filename) ) { $error = true; $error_msg = ( !empty($error_msg) ) ? $error_msg . '
    ' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format']; @@ -130,7 +130,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ } @fclose($fsock); - if ( !preg_match('/Content-Length\: ([0-9]+)[^\/ ][\s]+/i', $avatar_data, $file_data1) || !preg_match('/Content-Type\: image\/[x\-]*([a-z]+)[\s]+/i', $avatar_data, $file_data2) ) + if ( !preg_match('/Content-Length\: ([0-9]+)[^/ ][\s]+/i', $avatar_data, $file_data1) || !preg_match('/Content-Type\: image/[x\-]*([a-z]+)[\s]+/i', $avatar_data, $file_data2) ) { $error = true; $error_msg = ( !empty($error_msg) ) ? $error_msg . '
    ' . $lang['File_no_data'] : $lang['File_no_data'];