]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Merge remote-tracking branch 'upstream/develop' into post-delivery-data
[friendica.git] / include / items.php
index 6068be4b9469c71041ef7a498c1443ee5ead7823..38f4a58fba4bfb3b1e157c78fa9b5e0fb66baea1 100644 (file)
@@ -141,31 +141,22 @@ function query_page_info($url, $photo = "", $keywords = false, $keyword_blacklis
        return $data;
 }
 
-function add_page_keywords($url, $photo = "", $keywords = false, $keyword_blacklist = "", $return_array = false)
+function get_page_keywords($url, $photo = "", $keywords = false, $keyword_blacklist = "")
 {
        $data = query_page_info($url, $photo, $keywords, $keyword_blacklist);
+       if (empty($data["keywords"]) || !is_array($data["keywords"])) {
+               return [];
+       }
 
-       $tags = "";
        $taglist = [];
-       if (isset($data["keywords"]) && count($data["keywords"])) {
-               foreach ($data["keywords"] as $keyword) {
-                       $hashtag = str_replace([" ", "+", "/", ".", "#", "'"],
-                               ["", "", "", "", "", ""], $keyword);
-
-                       if ($tags != "") {
-                               $tags .= ", ";
-                       }
+       foreach ($data['keywords'] as $keyword) {
+               $hashtag = str_replace([" ", "+", "/", ".", "#", "'"],
+                       ["", "", "", "", "", ""], $keyword);
 
-                       $tags .= "#[url=" . DI::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
-                       $taglist[] = $hashtag;
-               }
+               $taglist[] = $hashtag;
        }
 
-       if ($return_array) {
-               return $taglist;
-       } else {
-               return $tags;
-       }
+       return $taglist;
 }
 
 function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "")