Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: class_parser.php 5520 2011-07-28 08:56:12Z Tomm $
| * $Id: class_parser.php 5710 2011-12-08 14:51:56Z Tomm $
|
*/
/*
| */
/*
|
Zeile 169 | Zeile 169 |
---|
{ foreach($code_matches as $text) {
|
{ foreach($code_matches as $text) {
|
| // Fix up HTML inside the code tags so it is clean if($options['allow_html'] != 0) { $text[2] = $this->parse_html($text[2]); }
|
if(my_strtolower($text[1]) == "code") { $code = $this->mycode_parse_code($text[2]);
| if(my_strtolower($text[1]) == "code") { $code = $this->mycode_parse_code($text[2]);
|
Zeile 189 | Zeile 195 |
---|
'$matches', 'return htmlspecialchars($matches[0]);' ), $message);
|
'$matches', 'return htmlspecialchars($matches[0]);' ), $message);
|
}
| }
|
if($options['nl2br'] !== 0) { $message = nl2br($message);
| if($options['nl2br'] !== 0) { $message = nl2br($message);
|
Zeile 256 | Zeile 262 |
---|
$standard_mycode['url_simple2']['regex'] = "#\[url\]([^\r\n\"<]+?)\[/url\]#ei"; $standard_mycode['url_simple2']['replacement'] = "\$this->mycode_parse_url(\"$1\")";
|
$standard_mycode['url_simple2']['regex'] = "#\[url\]([^\r\n\"<]+?)\[/url\]#ei"; $standard_mycode['url_simple2']['replacement'] = "\$this->mycode_parse_url(\"$1\")";
|
|
|
$standard_mycode['url_complex']['regex'] = "#\[url=([a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#esi"; $standard_mycode['url_complex']['replacement'] = "\$this->mycode_parse_url(\"$1$2\", \"$3\")";
| $standard_mycode['url_complex']['regex'] = "#\[url=([a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#esi"; $standard_mycode['url_complex']['replacement'] = "\$this->mycode_parse_url(\"$1$2\", \"$3\")";
|
Zeile 428 | Zeile 434 |
---|
$message = ' ' . $message . ' '; // First we take out any of the tags we don't want parsed between (url= etc)
|
$message = ' ' . $message . ' '; // First we take out any of the tags we don't want parsed between (url= etc)
|
preg_match_all("#\[(url(=[^\]]*)?\](.*?)\[\/url\]|quote=([^\]]*)?\])#i", $message, $bad_matches, PREG_PATTERN_ORDER); $message = preg_replace("#\[(url(=[^\]]*)?\](.*?)\[\/url\]|quote=([^\]]*)?\])#si", "<mybb-bad-sm>", $message);
| preg_match_all("#\[(url(=[^\]]*)?\]|quote=([^\]]*)?\])#i", $message, $bad_matches, PREG_PATTERN_ORDER); $message = preg_replace("#\[(url(=[^\]]*)?\]|quote=([^\]]*)?\])#si", "<mybb-bad-sm>", $message);
|
// Impose a hard limit of 500 smilies per message as to not overload the parser $remaining = 500;
| // Impose a hard limit of 500 smilies per message as to not overload the parser $remaining = 500;
|
Zeile 621 | Zeile 627 |
---|
do {
|
do {
|
| $previous_message = $message;
|
$message = preg_replace($pattern, $replace, $message, -1, $count); } while($count);
|
$message = preg_replace($pattern, $replace, $message, -1, $count); } while($count);
|
| if(!$message) { $message = $previous_message; }
|
if($text_only == false) {
| if($text_only == false) {
|
Zeile 693 | Zeile 705 |
---|
} $username = preg_replace("#(?:"|\"|')? dateline=(?:"|\"|')?[0-9]+(?:"|\"|')?#i", '', $username); $delete_quote = false;
|
} $username = preg_replace("#(?:"|\"|')? dateline=(?:"|\"|')?[0-9]+(?:"|\"|')?#i", '', $username); $delete_quote = false;
|
}
| }
|
if($delete_quote) { $username = my_substr($username, 0, my_strlen($username)-1);
| if($delete_quote) { $username = my_substr($username, 0, my_strlen($username)-1);
|
Zeile 868 | Zeile 880 |
---|
$name = my_substr($url, 0, 40)."...".my_substr($url, -10); } }
|
$name = my_substr($url, 0, 40)."...".my_substr($url, -10); } }
|
| $nofollow = ''; if(isset($this->options['nofollow_on'])) { $nofollow = " rel=\"nofollow\""; }
|
// 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);
$name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
|
// 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);
$name = preg_replace("#&\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
|
$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
| $link = "<a href=\"$fullurl\" target=\"_blank\"{$nofollow}>$name</a>";
|
return $link; }
| return $link; }
|
Zeile 948 | Zeile 966 |
---|
return "[video={$video}]{$url}[/video]"; }
|
return "[video={$video}]{$url}[/video]"; }
|
$parsed_url = @parse_url($url);
| $parsed_url = @parse_url(urldecode($url));
|
if($parsed_url == false) { return "[video={$video}]{$url}[/video]";;
| if($parsed_url == false) { return "[video={$video}]{$url}[/video]";;
|
Zeile 976 | Zeile 994 |
---|
{ case "dailymotion": list($id, ) = split("_", $path[2], 1); // http://www.dailymotion.com/video/fds123_title-goes-here
|
{ case "dailymotion": list($id, ) = split("_", $path[2], 1); // http://www.dailymotion.com/video/fds123_title-goes-here
|
break; case "googlevideo": $id = $input['docid']; // http://video.google.com/videoplay?docid=fds123
| |
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/
|