aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-02-25 05:46:52 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-02-25 05:46:52 +0000
commitf95e730adf1d77e65cb4c408b49a62e2888b5f64 (patch)
tree98903248b26be5dae0c1548c097b5a3139c84db1 /phpBB/includes
parent73a2c56104cdf97f35a0e1a417bbc3ec8e005050 (diff)
downloadforums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar
forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar.gz
forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar.bz2
forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar.xz
forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.zip
Another one bites the dust :D
- Nicer way of cleaning junk in PM export - Added various signature and posting controls :P git-svn-id: file:///svn/phpbb/trunk@5583 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_board.php16
-rw-r--r--phpBB/includes/message_parser.php26
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php7
3 files changed, 45 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 46d55a5ef5..7586da5a2d 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -97,7 +97,11 @@ class acp_board
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'type' => 'text:4:4', 'explain' => false),
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'type' => 'text:4:4', 'explain' => true),
- 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'type' => 'text:4:4', 'explain' => true)
+ 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'type' => 'text:5:4', 'explain' => true),
+ 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true),
+ 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'type' => 'text:4:4', 'explain' => true),
+ 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true),
+ 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true)
)
);
break;
@@ -115,6 +119,11 @@ class acp_board
'board_dst' => array('lang' => 'SYSTEM_DST', 'type' => 'radio:yes_no', 'explain' => false),
'allow_html_tags' => array('lang' => 'ALLOWED_TAGS', 'type' => 'text:30:255', 'explain' => true),
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true),
+ 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'type' => 'text:5:4', 'explain' => true),
+ 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true),
+ 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'type' => 'text:5:4', 'explain' => true),
+ 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true),
+ 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true),
@@ -126,6 +135,11 @@ class acp_board
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_sig_html' => array('lang' => 'ALLOW_SIG_HTML', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true)
)
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 292ab36d76..eb37168fdd 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -155,11 +155,18 @@ class bbcode_firstpass extends bbcode
function bbcode_size($stx, $in)
{
+ global $user, $config;
+
if (!$this->check_bbcode('size', $in))
{
return '';
}
+ if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx)
+ {
+ $this->warn_msg[] = sprintf($user->lang['MAX_FONT_SIZE_EXCEEDED'], $config['max_' . $this->mode . '_font_size']);
+ }
+
return '[size=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/size:' . $this->bbcode_uid . ']';
}
@@ -205,11 +212,26 @@ class bbcode_firstpass extends bbcode
function bbcode_img($in)
{
+ global $user, $config;
+
if (!$this->check_bbcode('img', $in))
{
return '';
}
+ if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
+ {
+ $stats = getimagesize($in);
+ if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1])
+ {
+ $this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
+ }
+ if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0])
+ {
+ $this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
+ }
+ }
+
return '[img:' . $this->bbcode_uid . ']' . $in . '[/img:' . $this->bbcode_uid . ']';
}
@@ -689,6 +711,8 @@ class parse_message extends bbcode_firstpass
var $allow_flash_bbcode = true;
var $allow_quote_bbcode = true;
+ var $mode;
+
// Init - give message here or manually
function parse_message($message = '')
{
@@ -708,6 +732,8 @@ class parse_message extends bbcode_firstpass
$mode = ($mode != 'post') ? 'sig' : 'post';
+ $this->mode = $mode;
+
$this->allow_img_bbcode = $allow_img_bbcode;
$this->allow_flash_bbcode = $allow_flash_bbcode;
$this->allow_quote_bbcode = $allow_quote_bbcode;
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index 173029f0bd..fff1b5928e 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -138,7 +138,8 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
if ($submit_export && ($export_type !== 'CSV' || ($delimiter !== '' && $enclosure !== '')))
{
- $sql = 'SELECT p.message_text
+ include_once($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
+ $sql = 'SELECT p.message_text, p.bbcode_uid
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE t.user_id = ' . $user->data['user_id'] . "
AND p.author_id = u.user_id
@@ -149,9 +150,9 @@ function view_folder($id, $mode, $folder_id, $folder, $type)
$message_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $message = preg_replace('#\[(\/?[a-z\*\+\-]+(?:=.*?)?)(?:\:?[0-9a-z]{5,})\]#', '[\1]', $message_row['message_text']);
+ decode_message($message_row['message_text'], $message_row['bbcode_uid']);
- $data[] = array('subject' => censor_text($row['message_subject']), 'from' => $row['username'], 'date' => $user->format_date($row['message_time']), 'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '', 'message' => $message);
+ $data[] = array('subject' => censor_text($row['message_subject']), 'from' => $row['username'], 'date' => $user->format_date($row['message_time']), 'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '', 'message' => $message_row['message_text']);
}
else if (!$submit_export || $export_type !== 'CSV')
{