Zeile 228 | Zeile 228 |
---|
$message = preg_replace("#(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)\s*<br />#i", "$1", $message); $message = preg_replace("#( )+(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)#i", "$2", $message); }
|
$message = preg_replace("#(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)\s*<br />#i", "$1", $message); $message = preg_replace("#( )+(</?(?:html|head|body|div|p|form|table|thead|tbody|tfoot|tr|td|th|ul|ol|li|div|p|blockquote|cite|hr)[^>]*>)#i", "$2", $message); }
|
$message = my_wordwrap($message);
| |
$message = $plugins->run_hooks("parse_message_end", $message);
| $message = $plugins->run_hooks("parse_message_end", $message);
|
Zeile 523 | Zeile 521 |
---|
{ $smilie['find'] = explode("\n", $smilie['find']); $smilie['image'] = str_replace("{theme}", $theme['imgdir'], $smilie['image']);
|
{ $smilie['find'] = explode("\n", $smilie['find']); $smilie['image'] = str_replace("{theme}", $theme['imgdir'], $smilie['image']);
|
$smilie['image'] = $mybb->get_asset_url($smilie['image']);
| $smilie['image'] = htmlspecialchars_uni($mybb->get_asset_url($smilie['image'])); $smilie['name'] = htmlspecialchars_uni($smilie['name']);
|
foreach($smilie['find'] as $s) {
| foreach($smilie['find'] as $s) {
|
Zeile 692 | Zeile 691 |
---|
"#(o)(nabort\s?=)#i" );
|
"#(o)(nabort\s?=)#i" );
|
$message = preg_replace($js_array, "$1<strong></strong>$2$4", $message);
| $message = preg_replace($js_array, "$1<strong></strong>$2$6", $message);
|
return $message; }
| return $message; }
|
Zeile 844 | Zeile 843 |
---|
{ $username = my_substr($username, 0, my_strlen($username)-1); }
|
{ $username = my_substr($username, 0, my_strlen($username)-1); }
|
| if(!empty($this->options['allow_html'])) { $username = htmlspecialchars_uni($username); }
|
if($text_only)
|
if($text_only)
|
{ return "\n".htmlspecialchars_uni($username)." $lang->wrote{$date}\n--\n{$message}\n--\n"; }
| { return "\n{$username} {$lang->wrote}{$date}\n--\n{$message}\n--\n"; }
|
else { $span = ""; if(!$delete_quote) { $span = "<span>{$date}</span>";
|
else { $span = ""; if(!$delete_quote) { $span = "<span>{$date}</span>";
|
}
return "<blockquote><cite>{$span}".htmlspecialchars_uni($username)." $lang->wrote{$linkback}</cite>{$message}</blockquote>\n"; } }
/** * Parses quotes with post id and/or dateline. * * @param array Matches. * @return string The parsed message.
| }
return "<blockquote><cite>{$span}{$username} {$lang->wrote}{$linkback}</cite>{$message}</blockquote>\n"; } }
/** * Parses quotes with post id and/or dateline. * * @param array Matches. * @return string The parsed message.
|
*/ function mycode_parse_post_quotes_callback1($matches) {
| */ function mycode_parse_post_quotes_callback1($matches) {
|
Zeile 1036 | Zeile 1040 |
---|
{ $url = "http://".$url; }
|
{ $url = "http://".$url; }
|
$fullurl = $url;
| |
|
|
if(!$name)
| if(!empty($this->options['allow_html'])) { $url = $this->parse_html($url); }
if(!$name)
|
{ $name = $url; }
|
{ $name = $url; }
|
if($name == $url && !empty($this->options['shorten_urls']))
| if($name == $url && (!isset($this->options['shorten_urls']) || !empty($this->options['shorten_urls'])))
|
{
|
{
|
if(my_strlen($url) > 55)
| $name = htmlspecialchars_decode($name); if(my_strlen($name) > 55)
|
{
|
{
|
$name = my_substr($url, 0, 40)."...".my_substr($url, -10);
| $name = my_substr($name , 0, 40).'...'.my_substr($name , -10);
|
}
|
}
|
}
| $name = htmlspecialchars_uni($name); }
|
$nofollow = ''; if(!empty($this->options['nofollow_on'])) {
| $nofollow = ''; if(!empty($this->options['nofollow_on'])) {
|
Zeile 1059 | Zeile 1069 |
---|
// Fix some entities in URLs $entities = array('$' => '%24', '$' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20');
|
// Fix some entities in URLs $entities = array('$' => '%24', '$' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20');
|
$fullurl = str_replace(array_keys($entities), array_values($entities), $fullurl);
| $url = str_replace(array_keys($entities), array_values($entities), $url);
|
$name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
|
$name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
|
$link = "<a href=\"$fullurl\" target=\"_blank\"{$nofollow}>$name</a>";
| $link = "<a href=\"$url\" target=\"_blank\"{$nofollow}>$name</a>";
|
return $link;
|
return $link;
|
}
/** * Parses URL MyCode. * * @param array Matches. * @return string The built-up link. */
| }
/** * Parses URL MyCode. * * @param array Matches. * @return string The built-up link. */
|
function mycode_parse_url_callback1($matches) { if(!isset($matches[3]))
| function mycode_parse_url_callback1($matches) { if(!isset($matches[3]))
|
Zeile 1079 | Zeile 1089 |
---|
$matches[3] = ''; } return $this->mycode_parse_url($matches[1].$matches[2], $matches[3]);
|
$matches[3] = ''; } return $this->mycode_parse_url($matches[1].$matches[2], $matches[3]);
|
}
| }
|
/** * Parses URL MyCode. *
| /** * Parses URL MyCode. *
|
Zeile 1090 | Zeile 1100 |
---|
function mycode_parse_url_callback2($matches) { if(!isset($matches[2]))
|
function mycode_parse_url_callback2($matches) { if(!isset($matches[2]))
|
{
| {
|
$matches[2] = ''; } return $this->mycode_parse_url($matches[1], $matches[2]);
| $matches[2] = ''; } return $this->mycode_parse_url($matches[1], $matches[2]);
|
Zeile 1108 | Zeile 1118 |
---|
$url = trim($url); $url = str_replace("\n", "", $url); $url = str_replace("\r", "", $url);
|
$url = trim($url); $url = str_replace("\n", "", $url); $url = str_replace("\r", "", $url);
|
if($align == "right")
| if(!empty($this->options['allow_html'])) { $url = $this->parse_html($url); }
$css_align = ''; if($align == "right")
|
{ $css_align = " style=\"float: right;\"";
|
{ $css_align = " style=\"float: right;\"";
|
}
| }
|
else if($align == "left")
|
else if($align == "left")
|
{
| {
|
$css_align = " style=\"float: left;\"";
|
$css_align = " style=\"float: left;\"";
|
} $alt = htmlspecialchars_uni(basename($url));
| } $alt = basename($url);
$alt = htmlspecialchars_decode($alt);
|
if(my_strlen($alt) > 55) {
|
if(my_strlen($alt) > 55) {
|
$alt = my_substr($alt, 0, 40)."...".my_substr($alt, -10);
| $alt = my_substr($alt, 0, 40).'...'.my_substr($alt, -10);
|
}
|
}
|
| $alt = htmlspecialchars_uni($alt);
|
$alt = $lang->sprintf($lang->posted_image, $alt);
|
$alt = $lang->sprintf($lang->posted_image, $alt);
|
if($dimensions[0] > 0 && $dimensions[1] > 0)
| if(isset($dimensions[0]) && $dimensions[0] > 0 && isset($dimensions[1]) && $dimensions[1] > 0)
|
{ return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} />"; }
| { return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"{$alt}\"{$css_align} />"; }
|
Zeile 1253 | Zeile 1274 |
---|
if(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+$/si", $email)) { return "<a href=\"mailto:$email\">".$name."</a>";
|
if(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+$/si", $email)) { return "<a href=\"mailto:$email\">".$name."</a>";
|
| } elseif(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+\?(.*?)$/si", $email)) { return "<a href=\"mailto:".htmlspecialchars_uni($email)."\">".$name."</a>";
|
} else {
| } else {
|
Zeile 1318 | Zeile 1343 |
---|
switch($video) { case "dailymotion":
|
switch($video) { case "dailymotion":
|
list($id, ) = split("_", $path[2], 1); // http://www.dailymotion.com/video/fds123_title-goes-here
| list($id) = explode('_', $path[2], 2); // http://www.dailymotion.com/video/fds123_title-goes-here
|
break; case "metacafe": $id = $path[2]; // http://www.metacafe.com/watch/fds123/title_goes_here/
| break; case "metacafe": $id = $path[2]; // http://www.metacafe.com/watch/fds123/title_goes_here/
|