]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Add move function to storage manager and console command
[friendica.git] / include / items.php
index c3113836138c1ff8c25784a109ca22dc2b0d355d..db60519a2ce8d6ba8d247ae207ce11fe06642862 100644 (file)
@@ -24,10 +24,7 @@ use Friendica\Util\ParseUrl;
 use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 
-require_once 'include/text.php';
 require_once 'mod/share.php';
-require_once 'include/enotify.php';
-
 function add_page_info_data(array $data, $no_photos = false)
 {
        Addon::callHooks('page_info_data', $data);
@@ -206,8 +203,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false)
                        $body = $removedlink;
                }
 
-               $url = str_replace(['/', '.'], ['\/', '\.'], $matches[1]);
-               $removedlink = preg_replace("/\[url\=" . $url . "\](.*?)\[\/url\]/ism", '', $body);
+               $removedlink = preg_replace("/\[url\=" . preg_quote($matches[1], '/') . "\](.*?)\[\/url\]/ism", '', $body);
                if (($removedlink == "") || strstr($body, $removedlink)) {
                        $body = $removedlink;
                }
@@ -352,7 +348,7 @@ function drop_item($id, $return = '')
 
        // locate item to be deleted
 
-       $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', parent];
+       $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'];
        $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
 
        if (!DBA::isResult($item)) {