diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 657ba7dc23..9e41065dea 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -525,7 +525,7 @@ function facebook_post_hook(&$a,&$b) { $search_str = $a->get_baseurl() . '/search'; - if(preg_match("/\[url=(.+?)\](.+?)\[\/url\]/is",$msg,$matches)) { + if(preg_match("/\[url=(.*?)\](.*?)\[\/url\]/is",$msg,$matches)) { // don't use hashtags for message link @@ -536,12 +536,12 @@ function facebook_post_hook(&$a,&$b) { } } - $msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 $1',$msg); + $msg = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/is",'$2 $1',$msg); - if(preg_match("/\[img\](.+?)\[\/img\]/is",$msg,$matches)) + if(preg_match("/\[img\](.*?)\[\/img\]/is",$msg,$matches)) $image = $matches[1]; - $msg = preg_replace("/\[img\](.+?)\[\/img\]/is", t('Image: ') . '$1', $msg); + $msg = preg_replace("/\[img\](.*?)\[\/img\]/is", t('Image: ') . '$1', $msg); if((strpos($link,$a->get_baseurl()) !== false) && (! $image)) $image = $a->get_baseurl() . '/images/friendika-64.jpg'; @@ -557,7 +557,7 @@ function facebook_post_hook(&$a,&$b) { $msg .= "\n"; foreach($arr as $r) { $matches = false; - $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches); + $cnt = preg_match('|\[attach\]href=\"(.*?)\" size=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches); if($cnt) { $msg .= $matches[1]; } diff --git a/boot.php b/boot.php index 88b822ceda..0eccb8498e 100644 --- a/boot.php +++ b/boot.php @@ -2574,7 +2574,7 @@ function prepare_body($item,$attach = false) { foreach($arr as $r) { $matches = false; $icon = ''; - $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches); + $cnt = preg_match('|\[attach\]href=\"(.*?)\" size=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches); if($cnt) { $icontype = strtolower(substr($matches[3],0,strpos($matches[3],'/'))); switch($icontype) { diff --git a/include/bbcode.php b/include/bbcode.php index 3caf2a6b17..c1576fbcf0 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -28,69 +28,69 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%\$\!\+\,]+)/", ' $2', $Text); $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '$1', $Text); - $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '$2', $Text); + $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.*?)\[/url\])", '$2', $Text); //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '$2', $Text); // Perform MAIL Search $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '$1', $Text); - $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '$2', $Text); + $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '$2', $Text); // Check for bold text - $Text = preg_replace("(\[b\](.+?)\[\/b])is",'$1',$Text); + $Text = preg_replace("(\[b\](.*?)\[\/b])is",'$1',$Text); // Check for Italics text - $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'$1',$Text); + $Text = preg_replace("(\[i\](.*?)\[\/i\])is",'$1',$Text); // Check for Underline text - $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'$1',$Text); + $Text = preg_replace("(\[u\](.*?)\[\/u\])is",'$1',$Text); // Check for strike-through text - $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'$1',$Text); + $Text = preg_replace("(\[s\](.*?)\[\/s\])is",'$1',$Text); // Check for over-line text - $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'$1',$Text); + $Text = preg_replace("(\[o\](.*?)\[\/o\])is",'$1',$Text); // Check for colored text - $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text); + $Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])is","$2",$Text); // Check for sized text - $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text); + $Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])is","$2",$Text); // Check for list text - $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '' ,$Text); - $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '' ,$Text); - $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s",'' ,$Text); - $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '' ,$Text); - $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '' ,$Text); - $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '' ,$Text); + $Text = preg_replace("/\[list\](.*?)\[\/list\]/is", '' ,$Text); + $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/is", '' ,$Text); + $Text = preg_replace("/\[list=i\](.*?)\[\/list\]/s",'' ,$Text); + $Text = preg_replace("/\[list=I\](.*?)\[\/list\]/s", '' ,$Text); + $Text = preg_replace("/\[list=a\](.*?)\[\/list\]/s", '' ,$Text); + $Text = preg_replace("/\[list=A\](.*?)\[\/list\]/s", '' ,$Text); $Text = str_replace("[*]", "
  • ", $Text); // Check for font change text - $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","$2",$Text); + $Text = preg_replace("(\[font=(.*?)\](.*?)\[\/font\])","$2",$Text); // Declare the format for [code] layout $CodeLayout = '$1'; // Check for [code] text - $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text); + $Text = preg_replace("/\[code\](.*?)\[\/code\]/is","$CodeLayout", $Text); // Declare the format for [quote] layout $QuoteLayout = '
    $1
    '; // Check for [quote] text - $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text); + $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/is","$QuoteLayout", $Text); // Images // [img]pathtoimage[/img] - $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '' . t('Image/photo') . '', $Text); + $Text = preg_replace("/\[img\](.*?)\[\/img\]/", '' . t('Image/photo') . '', $Text); // html5 video and audio - $Text = preg_replace("/\[video\](.+?)\[\/video\]/", '', $Text); + $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '', $Text); - $Text = preg_replace("/\[audio\](.+?)\[\/audio\]/", '', $Text); + $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '', $Text); // [img=widthxheight]image source[/img] - $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '', $Text); + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/", '', $Text); if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){ // use oembed for youtube links @@ -98,11 +98,11 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[\/youtube\]/",'[/embed]',$Text); } else { // Youtube extensions - $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '', $Text); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); } -// $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '', $Text); +// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); // oembed tag $Text = oembed_bbcode2html($Text); diff --git a/include/event.php b/include/event.php index 17e12d7cf9..33970efff9 100644 --- a/include/event.php +++ b/include/event.php @@ -12,8 +12,8 @@ function format_event_html($ev) { $o .= '

    ' . bbcode($ev['desc']) . '

    '; - $o .= '

    ' . t('Starts: ') . '' . (($ev['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $ev['start'] /*, format */ ) @@ -22,8 +22,8 @@ function format_event_html($ev) { . '

    '; if(! $ev['nofinish']) - $o .= '

    ' . t('Ends: ') . '' . (($ev['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $ev['finish'] /*, format */ ) diff --git a/include/items.php b/include/items.php index fbcac30cdf..dfe92378ae 100644 --- a/include/items.php +++ b/include/items.php @@ -1618,7 +1618,7 @@ function fix_private_photos($s,$uid) { $a = get_app(); logger('fix_private_photos'); - if(preg_match("/\[img\](.+?)\[\/img\]/is",$s,$matches)) { + if(preg_match("/\[img\](.*?)\[\/img\]/is",$s,$matches)) { $image = $matches[1]; logger('fix_private_photos: found photo ' . $image); if(stristr($image ,$a->get_baseurl() . '/photo/')) { @@ -1649,7 +1649,7 @@ function fix_private_photos($s,$uid) { function item_getfeedtags($item) { $ret = array(); $matches = false; - $cnt = preg_match_all('|\#\[url\=(.+?)\](.+?)\[\/url\]|',$item['tag'],$matches); + $cnt = preg_match_all('|\#\[url\=(.*?)\](.*?)\[\/url\]|',$item['tag'],$matches); if($cnt) { for($x = 0; $x < count($matches); $x ++) { if($matches[1][$x]) @@ -1657,7 +1657,7 @@ function item_getfeedtags($item) { } } $matches = false; - $cnt = preg_match_all('|\@\[url\=(.+?)\](.+?)\[\/url\]|',$item['tag'],$matches); + $cnt = preg_match_all('|\@\[url\=(.*?)\](.*?)\[\/url\]|',$item['tag'],$matches); if($cnt) { for($x = 0; $x < count($matches); $x ++) { if($matches[1][$x]) @@ -1673,7 +1673,7 @@ function item_getfeedattach($item) { if(count($arr)) { foreach($arr as $r) { $matches = false; - $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches); + $cnt = preg_match('|\[attach\]href=\"(.*?)\" size=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches); if($cnt) { $ret .= '