]> git.mxchange.org Git - friendica.git/blobdiff - include/bb2diaspora.php
Remove redir.php
[friendica.git] / include / bb2diaspora.php
index 80ee1b50dcc0b505f338ee79f1257287ba023f5a..714d780048b9724fe48f5570cd78ed6a433f65a7 100644 (file)
@@ -1,11 +1,12 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\System;
+use Friendica\Model\Contact;
 use Friendica\Network\Probe;
 
 use League\HTMLToMarkdown\HtmlConverter;
 
-require_once 'include/oembed.php';
 require_once 'include/event.php';
 require_once 'library/markdown.php';
 require_once 'include/html2bbcode.php';
@@ -22,7 +23,7 @@ function diaspora_mention2bb($match) {
                return;
        }
 
-       $data = get_contact_details_by_addr($match[2]);
+       $data = Contact::getDetailsByAddr($match[2]);
 
        $name = $match[1];
 
@@ -95,7 +96,7 @@ function diaspora2bb($s) {
  */
 function diaspora_mentions($match) {
 
-       $contact = get_contact_details_by_url($match[3]);
+       $contact = Contact::getDetailsByURL($match[3]);
 
        if (!x($contact, 'addr')) {
                $contact = Probe::uri($match[3]);
@@ -188,7 +189,7 @@ function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) {
        $Text = $converter->convert($Text);
 
        // unmask the special chars back to HTML
-       $Text = str_replace(array('&_lt_;', '&_gt_;', '&_amp_;'), array('&lt;', '&gt;', '&amp;'), $Text);
+       $Text = str_replace(array('&\_lt\_;', '&\_gt\_;', '&\_amp\_;'), array('&lt;', '&gt;', '&amp;'), $Text);
 
        $a->save_timestamp($stamp1, "parser");
 
@@ -241,7 +242,7 @@ function format_event_diaspora($ev) {
                        $ev['start'] , $bd_format ))
                        :  day_translate(datetime_convert('UTC', 'UTC',
                        $ev['start'] , $bd_format)))
-               .  '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
+               .  '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
 
        if (! $ev['nofinish']) {
                $o .= t('Finishes:') . ' ' . '['
@@ -249,7 +250,7 @@ function format_event_diaspora($ev) {
                                $ev['finish'] , $bd_format ))
                                :  day_translate(datetime_convert('UTC', 'UTC',
                                $ev['finish'] , $bd_format )))
-                       . '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
+                       . '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
        }
 
        if (strlen($ev['location'])) {