mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
More fixes, prune everything option (for forum admin), minor change to avatar mime type preg ... see if that helps with certain "doesn't match image type" issues
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3133 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ca6ad31ff8
commit
d51c358ddb
4 changed files with 9 additions and 7 deletions
|
@ -644,7 +644,7 @@ if( !empty($mode) )
|
||||||
|
|
||||||
|
|
||||||
include($phpbb_root_path . "includes/prune.$phpEx");
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -115,6 +115,8 @@ h3 {font-size:12pt;color:blue}
|
||||||
<li>Fixed non-updating of user rank when changing from special to normal rank in rank admin</li>
|
<li>Fixed non-updating of user rank when changing from special to normal rank in rank admin</li>
|
||||||
<li>Changed user topic notification default in schemas to 0 (off)</li>
|
<li>Changed user topic notification default in schemas to 0 (off)</li>
|
||||||
<li>Fixed non-XHTML compliant img tags in privmsg.php</li>
|
<li>Fixed non-XHTML compliant img tags in privmsg.php</li>
|
||||||
|
<li>Fixed non-deletion of announcements and polls when removing forum contents in forum admin</li>
|
||||||
|
<li></li>
|
||||||
<li></li>
|
<li></li>
|
||||||
<li></li>
|
<li></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -27,18 +27,18 @@ if ( !defined('IN_PHPBB') )
|
||||||
|
|
||||||
require($phpbb_root_path . 'includes/functions_search.'.$phpEx);
|
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;
|
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
|
$sql = "SELECT t.topic_id
|
||||||
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
|
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
|
||||||
WHERE t.forum_id = $forum_id
|
WHERE t.forum_id = $forum_id
|
||||||
AND t.topic_vote = 0
|
$prune_all
|
||||||
AND t.topic_type <> " . POST_ANNOUNCE . "
|
|
||||||
AND ( p.post_id = t.topic_last_post_id
|
AND ( p.post_id = t.topic_last_post_id
|
||||||
OR t.topic_last_post_id = 0 )";
|
OR t.topic_last_post_id = 0 )";
|
||||||
if ( $prune_date != '' )
|
if ( $prune_date != '' )
|
||||||
|
|
|
@ -83,7 +83,7 @@ function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename)
|
||||||
$avatar_filename = 'http://' . $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 = true;
|
||||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];
|
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $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);
|
@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 = true;
|
||||||
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['File_no_data'] : $lang['File_no_data'];
|
$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['File_no_data'] : $lang['File_no_data'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue