if (sizeof($links)) {
$link = array_pop($links);
- $url = "[url=".$link."]".$link."[/url]";
-
- $removedlink = trim(str_replace($url, "", $postarray['body']));
+ $url = str_replace(array('/', '.'), array('\/', '\.'), $link);
+ $removedlink = preg_replace("/\[url\=".$url."\](.*?)\[\/url\]/ism", '', $postarray['body']);
if (($removedlink == "") OR strstr($postarray['body'], $removedlink))
$postarray['body'] = $removedlink;
- if (($removedlink == "") OR strstr("[url]".$postarray['body']."[/url]", $removedlink))
- $postarray['body'] = $removedlink;
-
$page_info = add_page_info($link, false, $photo["url"]);
}
if (($footerlink != "") AND (trim($footer) != "")) {
$removedlink = trim(str_replace($footerlink, "", $body));
- if (strstr($body, $removedlink))
+ if (($removedlink == "") OR strstr($body, $removedlink))
$body = $removedlink;
$body .= $footer;
if (($footerlink != "") AND (trim($footer) != "")) {
$removedlink = trim(str_replace($footerlink, "", $body));
- if (strstr($body, $removedlink))
+ if (($removedlink == "") OR strstr($body, $removedlink))
$body = $removedlink;
$body .= $footer;