]> git.mxchange.org Git - friendica.git/commitdiff
Avoiding some PHP warnings
authorMichael Vogel <icarus@dabo.de>
Sun, 9 Mar 2014 08:26:54 +0000 (09:26 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 9 Mar 2014 08:26:54 +0000 (09:26 +0100)
include/html2plain.php
object/Item.php

index 445a4ab34723cdc0f0a74cf002bd54760a265641..54cc44794dc9e3a1ca96a622df0008bb78cd2b7b 100644 (file)
@@ -221,9 +221,10 @@ function html2plain($html, $wraplength = 75, $compact = false)
        if (!$compact AND ($message != "")) {
                $counter = 1;
                foreach ($urls as $id=>$url)
-                       if (strpos($message, $url) === false)
-                               $message .= "\n".$url." ";
-                               //$message .= "\n[".($counter++)."] ".$url;
+                       if ($url != "")
+                               if (strpos($message, $url) === false)
+                                       $message .= "\n".$url." ";
+                                       //$message .= "\n[".($counter++)."] ".$url;
        }
 
        $message = str_replace("\n«", "«\n", $message);
index 2cb131f1a7e267fa296be90e1880ae3aaaee4187..17a723acba32b093d51fe4a950f7e004f5d41f25 100644 (file)
@@ -269,22 +269,22 @@ class Item extends BaseObject {
                }
 
                // Disable features that aren't available in several networks
-               if ($item["item_network"] != "dfrn") {
+               if (($item["item_network"] != "dfrn") AND isset($buttons["dislike"])) {
                        unset($buttons["dislike"]);
                        $tagger = '';
                }
 
-               if ($item["item_network"] == "feed")
+               if (($item["item_network"] == "feed") AND isset($buttons["like"]))
                        unset($buttons["like"]);
 
-               if ($item["item_network"] == "mail")
+               if (($item["item_network"] == "mail") AND isset($buttons["like"]))
                        unset($buttons["like"]);
 
-               if (($item["item_network"] == "dspr") AND ($indent == 'comment'))
+               if (($item["item_network"] == "dspr") AND ($indent == 'comment') AND isset($buttons["like"]))
                        unset($buttons["like"]);
 
                // Facebook can like comments - but it isn't programmed in the connector yet.
-               if (($item["item_network"] == "face") AND ($indent == 'comment'))
+               if (($item["item_network"] == "face") AND ($indent == 'comment') AND isset($buttons["like"]))
                        unset($buttons["like"]);