]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Throw a ForbiddenException if api_get_user() returns false
[friendica.git] / include / items.php
index 1e4fe3ea012472f0ca6416d138305dd45d04af8e..af13898b2496d3f48d440314626a9f7b4fb37b2f 100644 (file)
@@ -185,7 +185,8 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
                        $body = $removedlink;
                }
 
-               $removedlink = preg_replace("/\[url\=" . preg_quote($matches[1]) . "\](.*?)\[\/url\]/ism", '', $body);
+               $url = str_replace(['/', '.'], ['\/', '\.'], $matches[1]);
+               $removedlink = preg_replace("/\[url\=" . $url . "\](.*?)\[\/url\]/ism", '', $body);
                if (($removedlink == "") || strstr($body, $removedlink)) {
                        $body = $removedlink;
                }
@@ -227,7 +228,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
  *
  * @TODO find proper type-hints
  */
-function consume_feed($xml, $importer, &$contact, &$hub, $datedir = 0, $pass = 0) {
+function consume_feed($xml, $importer, $contact, &$hub, $datedir = 0, $pass = 0) {
        if ($contact['network'] === NETWORK_OSTATUS) {
                if ($pass < 2) {
                        // Test - remove before flight
@@ -289,7 +290,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
                return;
        }
 
-       $push_url = Config::get('system','url') . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id'];
+       $push_url = System::baseUrl() . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id'];
 
        // Use a single verify token, even if multiple hubs
        $verify_token = ((strlen($contact['hub-verify'])) ? $contact['hub-verify'] : random_string());