Line 102 | Line 102 |
---|
/** * Init bbcode data for later parsing */
|
/** * Init bbcode data for later parsing */
|
function bbcode_init()
| function bbcode_init($allow_custom_bbcode = true)
|
{ static $rowset;
// This array holds all bbcode data. BBCodes will be processed in this // order, so it is important to keep [code] in first position and // [quote] in second position.
|
{ static $rowset;
// This array holds all bbcode data. BBCodes will be processed in this // order, so it is important to keep [code] in first position and // [quote] in second position.
|
| // To parse multiline URL we enable dotall option setting only for URL text // but not for link itself, thus [url][/url] is not affected.
|
$this->bbcodes = array(
|
$this->bbcodes = array(
|
'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#ise' => "\$this->bbcode_code('\$1', '\$2')")), 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#ise' => "\$this->bbcode_quote('\$0')")), 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")), 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")), 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")), 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")), 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#iUe' => "\$this->bbcode_img('\$1')")), 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")), 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")), 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")), 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")), 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")), 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
| 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")), 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")), 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uise' => "\$this->bbcode_attachment('\$1', '\$2')")), 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->bbcode_strong('\$1')")), 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uise' => "\$this->bbcode_italic('\$1')")), 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiUe' => "\$this->validate_url('\$2', ('\$3') ? '\$3' : '\$4')")), 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiUe' => "\$this->bbcode_img('\$1')")), 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uise' => "\$this->bbcode_size('\$1', '\$2')")), 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uise' => "\$this->bbcode_color('\$1', '\$2')")), 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uise' => "\$this->bbcode_underline('\$1')")), 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uise' => "\$this->bbcode_parse_list('\$0')")), 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uise' => "\$this->validate_email('\$1', '\$2')")), 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#uie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
|
);
// Zero the parsed items array
| );
// Zero the parsed items array
|
Line 131 | Line 133 |
---|
foreach ($this->bbcodes as $tag => $bbcode_data) { $this->parsed_items[$tag] = 0;
|
foreach ($this->bbcodes as $tag => $bbcode_data) { $this->parsed_items[$tag] = 0;
|
| }
if (!$allow_custom_bbcode) { return;
|
}
if (!is_array($rowset))
| }
if (!is_array($rowset))
|
Line 198 | Line 205 |
---|
if (!$this->check_bbcode('size', $in)) {
|
if (!$this->check_bbcode('size', $in)) {
|
return '';
| return $in;
|
}
if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx)
| }
if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx)
|
Line 224 | Line 231 |
---|
{ if (!$this->check_bbcode('color', $in)) {
|
{ if (!$this->check_bbcode('color', $in)) {
|
return '';
| return $in;
|
}
return '[color=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/color:' . $this->bbcode_uid . ']';
| }
return '[color=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/color:' . $this->bbcode_uid . ']';
|
Line 237 | Line 244 |
---|
{ if (!$this->check_bbcode('u', $in)) {
|
{ if (!$this->check_bbcode('u', $in)) {
|
return '';
| return $in;
|
}
return '[u:' . $this->bbcode_uid . ']' . $in . '[/u:' . $this->bbcode_uid . ']';
| }
return '[u:' . $this->bbcode_uid . ']' . $in . '[/u:' . $this->bbcode_uid . ']';
|
Line 250 | Line 257 |
---|
{ if (!$this->check_bbcode('b', $in)) {
|
{ if (!$this->check_bbcode('b', $in)) {
|
return '';
| return $in;
|
}
return '[b:' . $this->bbcode_uid . ']' . $in . '[/b:' . $this->bbcode_uid . ']';
| }
return '[b:' . $this->bbcode_uid . ']' . $in . '[/b:' . $this->bbcode_uid . ']';
|
Line 263 | Line 270 |
---|
{ if (!$this->check_bbcode('i', $in)) {
|
{ if (!$this->check_bbcode('i', $in)) {
|
return '';
| return $in;
|
}
return '[i:' . $this->bbcode_uid . ']' . $in . '[/i:' . $this->bbcode_uid . ']';
| }
return '[i:' . $this->bbcode_uid . ']' . $in . '[/i:' . $this->bbcode_uid . ']';
|
Line 278 | Line 285 |
---|
if (!$this->check_bbcode('img', $in)) {
|
if (!$this->check_bbcode('img', $in)) {
|
return '';
| return $in;
|
}
$in = trim($in);
| }
$in = trim($in);
|
Line 300 | Line 307 |
---|
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) {
|
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) {
|
$stats = @getimagesize($in);
| $stats = @getimagesize(htmlspecialchars_decode($in));
|
if ($stats === false) {
| if ($stats === false) {
|
Line 340 | Line 347 |
---|
if (!$this->check_bbcode('flash', $in)) {
|
if (!$this->check_bbcode('flash', $in)) {
|
return '';
| return $in;
|
}
$in = trim($in); $error = false;
|
}
$in = trim($in); $error = false;
|
| // Do not allow 0-sizes generally being entered if ($width <= 0 || $height <= 0) { return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; }
$in = str_replace(' ', '%20', $in);
// Make sure $in is a URL. if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in)) { return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; }
|
// Apply the same size checks on flash files as on images if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
| // Apply the same size checks on flash files as on images if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
|
Line 377 | Line 399 |
---|
{ if (!$this->check_bbcode('attachment', $in)) {
|
{ if (!$this->check_bbcode('attachment', $in)) {
|
return '';
| return $in;
|
}
return '[attachment=' . $stx . ':' . $this->bbcode_uid . ']<!-- ia' . $stx . ' -->' . trim($in) . '<!-- ia' . $stx . ' -->[/attachment:' . $this->bbcode_uid . ']';
| }
return '[attachment=' . $stx . ':' . $this->bbcode_uid . ']<!-- ia' . $stx . ' -->' . trim($in) . '<!-- ia' . $stx . ' -->[/attachment:' . $this->bbcode_uid . ']';
|
Line 385 | Line 407 |
---|
/** * Parse code text from code tag
|
/** * Parse code text from code tag
|
* @private
| * @access private
|
*/ function bbcode_parse_code($stx, &$code) {
| */ function bbcode_parse_code($stx, &$code) {
|
Line 394 | Line 416 |
---|
case 'php':
$remove_tags = false;
|
case 'php':
$remove_tags = false;
|
$code = str_replace(array('<', '>'), array('<', '>'), $code);
| $str_from = array('<', '>', '[', ']', '.', ':', ':'); $str_to = array('<', '>', '[', ']', '.', ':', ':'); $code = str_replace($str_from, $str_to, $code);
|
if (!preg_match('/\<\?.*?\?\>/is', $code)) {
| if (!preg_match('/\<\?.*?\?\>/is', $code)) {
|
Line 457 | Line 482 |
---|
{ if (!$this->check_bbcode('code', $in)) {
|
{ if (!$this->check_bbcode('code', $in)) {
|
return '';
| return $in;
|
}
// We remove the hardcoded elements from the code block here because it is not used in code blocks
| }
// We remove the hardcoded elements from the code block here because it is not used in code blocks
|
Line 550 | Line 575 |
---|
{ if (!$this->check_bbcode('list', $in)) {
|
{ if (!$this->check_bbcode('list', $in)) {
|
return '';
| return $in;
|
}
// $tok holds characters to stop at. Since the string starts with a '[' we'll get everything up to the first ']' which should be the opening [list] tag
| }
// $tok holds characters to stop at. Since the string starts with a '[' we'll get everything up to the first ']' which should be the opening [list] tag
|
Line 595 | Line 620 |
---|
$out .= array_pop($list_end_tags) . ']'; $tok = '['; }
|
$out .= array_pop($list_end_tags) . ']'; $tok = '['; }
|
else if (preg_match('#^list(=[0-9a-z])?$#i', $buffer, $m))
| else if (preg_match('#^list(=[0-9a-z]+)?$#i', $buffer, $m))
|
{ // sub-list, add a closing tag
|
{ // sub-list, add a closing tag
|
if (empty($m[1]) || preg_match('/^(?:disc|square|circle)$/i', $m[1]))
| if (empty($m[1]) || preg_match('/^=(?:disc|square|circle)$/i', $m[1]))
|
{ array_push($list_end_tags, '/list:u:' . $this->bbcode_uid); }
| { array_push($list_end_tags, '/list:u:' . $this->bbcode_uid); }
|
Line 684 | Line 709 |
---|
* #14667 - [quote]test[/quote] test ] and [ test [quote]test[/quote] (correct: parsed) * #14770 - [quote="["]test[/quote] (correct: parsed) * [quote="[i]test[/i]"]test[/quote] (correct: parsed)
|
* #14667 - [quote]test[/quote] test ] and [ test [quote]test[/quote] (correct: parsed) * #14770 - [quote="["]test[/quote] (correct: parsed) * [quote="[i]test[/i]"]test[/quote] (correct: parsed)
|
* [quote="[quote]test[/quote]"]test[/quote] (correct: NOT parsed)
| * [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote]) * #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted) * #40565 - [quote="a"]a[/quote][quote="a]a[/quote] (correct: first quote tag parsed, second quote tag unparsed)
|
*/
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
| */
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
|
Line 695 | Line 722 |
---|
}
// To let the parser not catch tokens within quote_username quotes we encode them before we start this...
|
}
// To let the parser not catch tokens within quote_username quotes we encode them before we start this...
|
$in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']'), array('[', ']'), '\$1') . '"]'", $in);
| $in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), '\$1') . '"]'", $in);
|
$tok = ']'; $out = '[';
| $tok = ']'; $out = '[';
|
Line 737 | Line 764 |
---|
$out .= ' '; }*/ }
|
$out .= ' '; }*/ }
|
else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m))
| else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m) && substr($out, -1, 1) == '[')
|
{ $this->parsed_items['quote']++;
| { $this->parsed_items['quote']++;
|
Line 847 | Line 874 |
---|
} } while ($in);
|
} } while ($in);
|
| $out .= $buffer;
|
if (sizeof($close_tags)) {
| if (sizeof($close_tags)) {
|
Line 913 | Line 942 |
---|
$url = ($var1) ? $var1 : $var2;
|
$url = ($var1) ? $var1 : $var2;
|
if (!$url || ($var1 && !$var2))
| if ($var1 && !$var2)
|
{
|
{
|
return '';
| $var2 = $var1; }
if (!$url) { return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]';
|
}
$valid = false;
| }
$valid = false;
|
Line 978 | Line 1012 |
---|
// Is the user trying to link to a php file in this domain and script path? if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false) {
|
// Is the user trying to link to a php file in this domain and script path? if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false) {
|
$server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
| $server_name = $user->host;
|
// Forcing server vars is the only way to specify/override the protocol if ($config['force_server_vars'] || !$server_name)
| // Forcing server vars is the only way to specify/override the protocol if ($config['force_server_vars'] || !$server_name)
|
Line 1034 | Line 1068 |
---|
{ // Init BBCode UID $this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
|
{ // Init BBCode UID $this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
|
if ($message) {
| |
$this->message = $message;
|
$this->message = $message;
|
}
| |
}
/**
| }
/**
|
Line 1047 | Line 1077 |
---|
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') { global $config, $db, $user;
|
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') { global $config, $db, $user;
|
$mode = ($mode != 'post') ? 'sig' : 'post';
| |
$this->mode = $mode;
|
$this->mode = $mode;
|
| foreach (array('chars', 'smilies', 'urls', 'font_size', 'img_height', 'img_width') as $key) { if (!isset($config['max_' . $mode . '_' . $key])) { $config['max_' . $mode . '_' . $key] = 0; } }
|
$this->allow_img_bbcode = $allow_img_bbcode; $this->allow_flash_bbcode = $allow_flash_bbcode;
| $this->allow_img_bbcode = $allow_img_bbcode; $this->allow_flash_bbcode = $allow_flash_bbcode;
|
Line 1075 | Line 1111 |
---|
$replace = array("\\1:"); $this->message = preg_replace($match, $replace, trim($this->message));
|
$replace = array("\\1:"); $this->message = preg_replace($match, $replace, trim($this->message));
|
// Message length check. 0 disables this check completely. if ($config['max_' . $mode . '_chars'] > 0) { $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
| // Store message length... $message_length = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
|
|
|
if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars'])
| // Maximum message length check. 0 disables this check completely. if ((int) $config['max_' . $mode . '_chars'] > 0 && $message_length > (int) $config['max_' . $mode . '_chars'])
|
{
|
{
|
$this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']); return $this->warn_msg; }
| $this->warn_msg[] = sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $message_length, (int) $config['max_' . $mode . '_chars']); return (!$update_this_message) ? $return_message : $this->warn_msg;
|
}
|
}
|
// Check for "empty" message if ($mode !== 'sig' && !utf8_clean_string($this->message))
| // Minimum message length check for post only if ($mode === 'post')
|
{
|
{
|
$this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return $this->warn_msg;
| if (!$message_length || $message_length < (int) $config['min_post_chars']) { $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $message_length, (int) $config['min_post_chars']); return (!$update_this_message) ? $return_message : $this->warn_msg; }
|
}
// Prepare BBcode (just prepares some tags for better parsing)
| }
// Prepare BBcode (just prepares some tags for better parsing)
|
Line 1134 | Line 1171 |
---|
{ $num_urls += preg_match_all('#\<!-- ([lmwe]) --\>.*?\<!-- \1 --\>#', $this->message, $matches); }
|
{ $num_urls += preg_match_all('#\<!-- ([lmwe]) --\>.*?\<!-- \1 --\>#', $this->message, $matches); }
|
| }
// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length. // The maximum length check happened before any parsings. if ($mode === 'post' && utf8_clean_string($this->message) === '') { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return (!$update_this_message) ? $return_message : $this->warn_msg;
|
}
// Check number of links if ($config['max_' . $mode . '_urls'] && $num_urls > $config['max_' . $mode . '_urls']) { $this->warn_msg[] = sprintf($user->lang['TOO_MANY_URLS'], $config['max_' . $mode . '_urls']);
|
}
// Check number of links if ($config['max_' . $mode . '_urls'] && $num_urls > $config['max_' . $mode . '_urls']) { $this->warn_msg[] = sprintf($user->lang['TOO_MANY_URLS'], $config['max_' . $mode . '_urls']);
|
return $this->warn_msg;
| return (!$update_this_message) ? $return_message : $this->warn_msg;
|
}
if (!$update_this_message)
| }
if (!$update_this_message)
|
Line 1255 | Line 1300 |
---|
{ case 'mssql': case 'mssql_odbc':
|
{ case 'mssql': case 'mssql_odbc':
|
| case 'mssqlnative':
|
$sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ORDER BY LEN(code) DESC';
| $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ORDER BY LEN(code) DESC';
|
Line 1283 | Line 1329 |
---|
}
// (assertion)
|
}
// (assertion)
|
$match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';
| $match[] = preg_quote($row['code'], '#');
|
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; } $db->sql_freeresult($result);
| $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; } $db->sql_freeresult($result);
|
Line 1293 | Line 1339 |
---|
{ if ($max_smilies) {
|
{ if ($max_smilies) {
|
$num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches);
| // 'u' modifier has been added to correctly parse smilies within unicode strings // For details: http://tracker.phpbb.com/browse/PHPBB3-10117 $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#u', $this->message, $matches);
|
unset($matches);
if ($num_matches !== false && $num_matches > $max_smilies)
| unset($matches);
if ($num_matches !== false && $num_matches > $max_smilies)
|
Line 1304 | Line 1352 |
---|
}
// Make sure the delimiter # is added in front and at the end of every element within $match
|
}
// Make sure the delimiter # is added in front and at the end of every element within $match
|
$this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message));
| // 'u' modifier has been added to correctly parse smilies within unicode strings // For details: http://tracker.phpbb.com/browse/PHPBB3-10117
$this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#u' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#u'), $replace, $this->message));
|
} }
| } }
|
Line 1597 | Line 1648 |
---|
$this->message = $poll['poll_option_text']; $bbcode_bitfield = $this->bbcode_bitfield;
|
$this->message = $poll['poll_option_text']; $bbcode_bitfield = $this->bbcode_bitfield;
|
$poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
| $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
|
$bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); $this->message = $tmp_message;
| $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); $this->message = $tmp_message;
|
Line 1621 | Line 1671 |
---|
{ $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; }
|
{ $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; }
|
$poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
| $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
|
if (strlen($poll['poll_title']) > 255) { $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG'];
| if (strlen($poll['poll_title']) > 255) { $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG'];
|