]> git.mxchange.org Git - friendica.git/blobdiff - include/html2plain.php
Merge remote-tracking branch 'upstream/master'
[friendica.git] / include / html2plain.php
index 7aa20500a57a1ad2594fa4f489743035dc343ebb..572f9714a32162f2ffc1504aab4708df4b6600f0 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-require_once "html2bbcode.php";
+require_once("include/html2bbcode.php");
 
 function breaklines($line, $level, $wraplength = 75)
 {
@@ -83,7 +83,7 @@ function collecturls($message) {
        $urls = array();
        foreach ($result as $treffer) {
                // A list of some links that should be ignored
-               $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "mailto:", "/u/", "/node/",
+               $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "/search?tag=", "mailto:", "/u/", "/node/",
                                "//facebook.com/profile.php?id=", "//plus.google.com/");
                foreach ($list as $listitem)
                        if (strpos($treffer[1], $listitem) !== false)
@@ -92,6 +92,9 @@ function collecturls($message) {
                if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false))
                                $ignore = false;
 
+               if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/photos") !== false))
+                               $ignore = false;
+
                if (!$ignore)
                        $urls[$treffer[1]] = $treffer[1];
        }
@@ -157,7 +160,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
        //node2bbcode($doc, 'ol', array(), "\n[list=1]", "[/list]\n");
        node2bbcode($doc, 'li', array(), "\n* ", "\n");
 
-       node2bbcode($doc, 'hr', array(), str_repeat("-", 70), "");
+       node2bbcode($doc, 'hr', array(), "\n".str_repeat("-", 70)."\n", "");
 
        node2bbcode($doc, 'tr', array(), "\n", "");
        node2bbcode($doc, 'td', array(), "\t", "");
@@ -206,7 +209,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
        if (!$compact) {
                $counter = 1;
                foreach ($urls as $id=>$url)
-                       if (strpos($message, $url) == false)
+                       if (strpos($message, $url) === false)
                                $message .= "\n".$url." ";
                                //$message .= "\n[".($counter++)."] ".$url;
        }