]> git.mxchange.org Git - friendica.git/commitdiff
Fix warnings
authorMichael Vogel <icarus@dabo.de>
Mon, 18 Nov 2019 18:09:21 +0000 (19:09 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 18 Nov 2019 18:09:21 +0000 (19:09 +0100)
src/Model/GServer.php
src/Protocol/Feed.php

index d759a24dff88f44adf9a6404cfccce754490866b..074e1b61304540f186deb08af30417d20a4e52fb 100644 (file)
@@ -1061,7 +1061,7 @@ class GServer
                        $attr = [];
                        if ($node->attributes->length) {
                                foreach ($node->attributes as $attribute) {
-                                       $attribute->value = trim($attribute->value);
+                                       $attribute->value = @trim($attribute->value);
                                        if (empty($attribute->value)) {
                                                continue;
                                        }
@@ -1117,7 +1117,7 @@ class GServer
                        $attr = [];
                        if ($node->attributes->length) {
                                foreach ($node->attributes as $attribute) {
-                                       $attribute->value = trim($attribute->value);
+                                       $attribute->value = @trim($attribute->value);
                                        if (empty($attribute->value)) {
                                                continue;
                                        }
index 0c9501387c145b0322773025a553a4c08e17853e..705a094c38149b433b454fc2b5626181ebb9b598 100644 (file)
@@ -422,7 +422,7 @@ class Feed {
                                $data = ParseUrl::getSiteinfoCached($item['plink'], true);
                                if (!empty($data['text']) && !empty($data['title']) && (mb_strlen($item['body']) < mb_strlen($data['text']))) {
                                        // When the fetched page info text is longer than the body, we do try to enhance the body
-                                       if ((strpos($data['title'], $item['body']) === false) && (strpos($data['text'], $item['body']) === false)) {
+                                       if (!empty($item['body']) && (strpos($data['title'], $item['body']) === false) && (strpos($data['text'], $item['body']) === false)) {
                                                // The body is not part of the fetched page info title or page info text. So we add the text to the body
                                                $item['body'] .= "\n\n" . $data['text'];
                                        } else {