]> git.mxchange.org Git - friendica.git/commitdiff
Just look at HTTP links
authorMichael <heluecht@pirati.ca>
Tue, 6 Jul 2021 16:10:10 +0000 (16:10 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 6 Jul 2021 16:10:10 +0000 (16:10 +0000)
src/Model/Post/Link.php

index 3bd92bfe346f230b73b29b47e60dfcee8c3ed2a5..7cce4e206ba6f1402f9b92d7bb4b1db2f40f6360 100644 (file)
@@ -103,19 +103,19 @@ class Link
         */
        public static function insertFromBody(int $uriid, string $body)
        {
-               if (preg_match_all("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", $body, $pictures, PREG_SET_ORDER)) {
+               if (preg_match_all("/\[img\=([0-9]*)x([0-9]*)\](http.*?)\[\/img\]/ism", $body, $pictures, PREG_SET_ORDER)) {
                        foreach ($pictures as $picture) {
                                $body = str_replace($picture[3], self::getByLink($uriid, $picture[3]), $body);
                        }
                }
 
-               if (preg_match_all("/\[img=([^\[\]]*)\]([^\[\]]*)\[\/img\]/Usi", $body, $pictures, PREG_SET_ORDER)) {
+               if (preg_match_all("/\[img=(http[^\[\]]*)\]([^\[\]]*)\[\/img\]/Usi", $body, $pictures, PREG_SET_ORDER)) {
                        foreach ($pictures as $picture) {
                                $body = str_replace($picture[1], self::getByLink($uriid, $picture[1]), $body);
                        }
                }
 
-               if (preg_match_all("/\[img\]([^\[\]]*)\[\/img\]/ism", $body, $pictures, PREG_SET_ORDER)) {
+               if (preg_match_all("/\[img\](http[^\[\]]*)\[\/img\]/ism", $body, $pictures, PREG_SET_ORDER)) {
                        foreach ($pictures as $picture) {
                                $body = str_replace($picture[1], self::getByLink($uriid, $picture[1]), $body);
                        }