aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php30
1 files changed, 6 insertions, 24 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 8a178d1ac..5c93ac3aa 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -116,22 +116,11 @@ function diaspora_mention_callback($matches) {
function diaspora2bb($s,$use_zrl = false) {
+ $s = str_replace("
","\r",$s);
$s = str_replace("
\n>","",$s);
$s = html_entity_decode($s,ENT_COMPAT,'UTF-8');
- // Too many new lines. So deactivated the following line
- // $s = str_replace("\r","\n",$s);
- // Simply remove cr.
- $s = str_replace("\r","",$s);
-
- // <br/> is invalid. Replace it with the valid expression
- $s = str_replace("<br/>","<br />",$s);
- $s = str_replace("\n","<br />",$s);
-
-
-// $s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
-
// first try plustags
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_mention_callback',$s);
@@ -143,16 +132,13 @@ function diaspora2bb($s,$use_zrl = false) {
// This seems to work
$s = preg_replace('/\#([^\s\#])/','&#35;$1',$s);
- $s = preg_replace_callback('/\[share(.*?)\]/ism','share_shield',$s);
-
$s = Markdown($s);
+ $s = str_replace("\r","",$s);
+
$s = str_replace('&#35;','#',$s);
-// we seem to have double linebreaks
-// $s = str_replace("\n",'<br />',$s);
$s = html2bbcode($s);
-// $s = str_replace('&#42;','*',$s);
// protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands
$s = str_replace('&#x2672;',html_entity_decode('&#x2672;',ENT_QUOTES,'UTF-8'),$s);
@@ -175,10 +161,6 @@ function diaspora2bb($s,$use_zrl = false) {
// remove duplicate adjacent code tags
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
-
- $s = preg_replace_callback('/\[share(.*?)\]/ism','share_unshield',$s);
-
-
// Don't show link to full picture (until it is fixed)
$s = scale_external_images($s, false);
@@ -277,7 +259,7 @@ function bb2diaspora_itemwallwall(&$item) {
}
if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author']))) {
- logger('bb2diaspora_itemwallwall: author: ' . print_r($item['author'],true), LOGGER_DEBUG);
+ logger('bb2diaspora_itemwallwall: author: ' . print_r($item['author'],true), LOGGER_DATA);
}
if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
@@ -388,7 +370,7 @@ function bb2diaspora_itembody($item,$force_update = false) {
}
}
- logger('bb2diaspora_itembody : ' . $body);
+// logger('bb2diaspora_itembody : ' . $body, LOGGER_DATA);
return html_entity_decode($body);
@@ -462,7 +444,7 @@ function format_event_diaspora($ev) {
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
- $o = 'Friendica event notification:' . "\n";
+ $o = t('Redmatrix event notification:') . "\n";
$o .= '**' . (($ev['summary']) ? bb2diaspora($ev['summary']) : bb2diaspora($ev['desc'])) . '**' . "\n";