Zeile 368 | Zeile 368 |
---|
if($mybb->settings['allowfontmycode'] == 1) {
|
if($mybb->settings['allowfontmycode'] == 1) {
|
$nestable_mycode['font']['regex'] = "#\[font=([a-z0-9 ,\-_'\"]+)\](.*?)\[/font\]#si"; $nestable_mycode['font']['replacement'] = "<span style=\"font-family: $1;\" class=\"mycode_font\">$2</span>";
| $nestable_mycode['font']['regex'] = "#\[font=(\"?)([a-z0-9 ,\-_']+)\\1\](.*?)\[/font\]#si"; $nestable_mycode['font']['replacement'] = "<span style=\"font-family: $2;\" class=\"mycode_font\">$3</span>";
|
++$nestable_count; }
| ++$nestable_count; }
|
Zeile 1346 | Zeile 1346 |
---|
if(!$name) { $name = $email;
|
if(!$name) { $name = $email;
|
} if(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+$/si", $email)) { $email = $email; } elseif(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+\?(.*?)$/si", $email)) { $email = htmlspecialchars_uni($email);
| |
}
|
}
|
| $email = $this->encode_url($email);
|
eval("\$mycode_email = \"".$templates->get("mycode_email", 1, 0)."\";"); return $mycode_email;
|
eval("\$mycode_email = \"".$templates->get("mycode_email", 1, 0)."\";"); return $mycode_email;
|
}
| }
|
/** * Parses email MyCode.
|
/** * Parses email MyCode.
|
*
| *
|
* @param array $matches Matches * @return string The built-up email link. */ function mycode_parse_email_callback($matches)
|
* @param array $matches Matches * @return string The built-up email link. */ function mycode_parse_email_callback($matches)
|
{
| {
|
if(!isset($matches[2])) { $matches[2] = '';
| if(!isset($matches[2])) { $matches[2] = '';
|
Zeile 1387 | Zeile 1381 |
---|
global $templates;
if(empty($video) || empty($url))
|
global $templates;
if(empty($video) || empty($url))
|
{ return "[video={$video}]{$url}[/video]";
| { return "[video={$video}]{$url}[/video]";
|
}
// Check URL is a valid URL first, as `parse_url` doesn't check validity.
| }
// Check URL is a valid URL first, as `parse_url` doesn't check validity.
|
Zeile 1490 | Zeile 1484 |
---|
if(isset($path[3])) { $id = $path[3]; // http://vimeo.com/fds/fds/fds123
|
if(isset($path[3])) { $id = $path[3]; // http://vimeo.com/fds/fds/fds123
|
} else
| } else
|
{ $id = $path[1]; // http://vimeo.com/fds123 }
| { $id = $path[1]; // http://vimeo.com/fds123 }
|
Zeile 1536 | Zeile 1530 |
---|
return "[video={$video}]{$url}[/video]"; }
|
return "[video={$video}]{$url}[/video]"; }
|
$id = htmlspecialchars_uni($id);
| $id = $this->encode_url($id);
|
eval("\$video_code = \"".$templates->get("video_{$video}_embed", 1, 0)."\";"); return $video_code;
| eval("\$video_code = \"".$templates->get("video_{$video}_embed", 1, 0)."\";"); return $video_code;
|
Zeile 1594 | Zeile 1588 |
---|
// Links should end with slashes, numbers, characters and braces but not with dots, commas or question marks // Don't create links within existing links (handled up-front in the callback function).
|
// Links should end with slashes, numbers, characters and braces but not with dots, commas or question marks // Don't create links within existing links (handled up-front in the callback function).
|
$message = preg_replace_callback("#<a\\s[^>]*>.*?</a>|([\s\(\)\[\>])(http|https|ftp|news|irc|ircs|irc6){1}://([^\/\"\s\<\[\.]+\.([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/([^\"\s<\[]|\[\])*)?([\w\/\)]))#ius", array($this, 'mycode_auto_url_callback'), $message); $message = preg_replace_callback("#<a\\s[^>]*>.*?</a>|([\s\(\)\[\>])(www|ftp)\.(([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/([^\"\s<\[]|\[\])*)?([\w\/\)]))#ius", array($this, 'mycode_auto_url_callback'), $message); $message = my_substr($message, 1);
| $message = preg_replace_callback("#<a\\s[^>]*>.*?</a>|([\s\(\)\[\>])(http|https|ftp|news|irc|ircs|irc6){1}(://)([^\/\"\s\<\[\.]+\.([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/([^\"\s<\[]|\[\])*)?([\w\/\)]))#ius", array($this, 'mycode_auto_url_callback'), $message); $message = preg_replace_callback("#<a\\s[^>]*>.*?</a>|([\s\(\)\[\>])(www|ftp)(\.)(([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/([^\"\s<\[]|\[\])*)?([\w\/\)]))#ius", array($this, 'mycode_auto_url_callback'), $message); $message = my_substr($message, 1);
|
return $message; }
| return $message; }
|
Zeile 1614 | Zeile 1608 |
---|
if(count($matches) == 1) { return $matches[0];
|
if(count($matches) == 1) { return $matches[0];
|
}
| }
|
$external = ''; // Allow links like http://en.wikipedia.org/wiki/PHP_(disambiguation) but detect mismatching braces
|
$external = ''; // Allow links like http://en.wikipedia.org/wiki/PHP_(disambiguation) but detect mismatching braces
|
while(my_substr($matches[3], -1) == ')') { if(substr_count($matches[3], ')') > substr_count($matches[3], '(')) { $matches[3] = my_substr($matches[3], 0, -1);
| while(my_substr($matches[4], -1) == ')') { if(substr_count($matches[4], ')') > substr_count($matches[4], '(')) { $matches[4] = my_substr($matches[4], 0, -1);
|
$external = ')'.$external; } else
|
$external = ')'.$external; } else
|
{
| {
|
break; }
// Example: ([...] http://en.wikipedia.org/Example_(disambiguation).)
|
break; }
// Example: ([...] http://en.wikipedia.org/Example_(disambiguation).)
|
$last_char = my_substr($matches[3], -1);
| $last_char = my_substr($matches[4], -1);
|
while($last_char == '.' || $last_char == ',' || $last_char == '?' || $last_char == '!') {
|
while($last_char == '.' || $last_char == ',' || $last_char == '?' || $last_char == '!') {
|
$matches[3] = my_substr($matches[3], 0, -1);
| $matches[4] = my_substr($matches[4], 0, -1);
|
$external = $last_char.$external;
|
$external = $last_char.$external;
|
$last_char = my_substr($matches[3], -1);
| $last_char = my_substr($matches[4], -1);
|
} }
|
} }
|
if(in_array(strtolower($matches[2]), array('www', 'ftp'))) { $url = "{$matches[2]}.{$matches[3]}"; } else { $url = "{$matches[2]}://{$matches[3]}"; }
| $url = "{$matches[2]}{$matches[3]}{$matches[4]}";
|
return $matches[1].$this->mycode_parse_url($url, $url).$external; }
| return $matches[1].$this->mycode_parse_url($url, $url).$external; }
|
Zeile 1815 | Zeile 1802 |
---|
"#\[img=([1-9][0-9]*)x([1-9][0-9]*)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", "#\[url=((?!javascript)[a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#si", "#\[url=((?!javascript:)[^\r\n\"<&\(\)]+?)\](.+?)\[/url\]#si",
|
"#\[img=([1-9][0-9]*)x([1-9][0-9]*)\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#is", "#\[url=((?!javascript)[a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#si", "#\[url=((?!javascript:)[^\r\n\"<&\(\)]+?)\](.+?)\[/url\]#si",
|
| "#\[attachment=([0-9]+?)\]#i",
|
);
$replace = array(
| );
$replace = array(
|
Zeile 1823 | Zeile 1811 |
---|
"$4", "$3 ($1$2)", "$2 ($1)",
|
"$4", "$3 ($1$2)", "$2 ($1)",
|
| "",
|
); $messageBefore = "";
| ); $messageBefore = "";
|