]> git.mxchange.org Git - friendica.git/blobdiff - include/plaintext.php
Close DB connection in api_saved_searches_list
[friendica.git] / include / plaintext.php
index 53015c961f3487230858dbeaac8df2711675902d..39dcc9ecdbd7d888cdc6c601bde0acc3570a4dd9 100644 (file)
@@ -1,16 +1,15 @@
 <?php
-
 /**
  * @file include/plaintext.php
  */
-
 use Friendica\App;
 use Friendica\ParseUrl;
+use Friendica\Core\PConfig;
+use Friendica\Object\Image;
 
-require_once("include/Photo.php");
-require_once("include/bbcode.php");
-require_once("include/html2plain.php");
-require_once("include/network.php");
+require_once "include/bbcode.php";
+require_once "include/html2plain.php";
+require_once "include/network.php";
 
 /**
  * @brief Fetches attachment data that were generated the old way
@@ -52,7 +51,7 @@ function get_old_attachment_data($body) {
 
                        if (preg_match("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $attacheddata, $matches)) {
 
-                               $picturedata = get_photo_info($matches[1]);
+                               $picturedata = Image::getInfoFromURL($matches[1]);
 
                                if (($picturedata[0] >= 500) && ($picturedata[0] >= $picturedata[1]))
                                        $post["image"] = $matches[1];
@@ -222,7 +221,7 @@ function get_attached_data($body, $item = array()) {
                                        $post["preview"] = $pictures[0][2];
                                        $post["text"] = str_replace($pictures[0][0], "", $body);
                                } else {
-                                       $imgdata = get_photo_info($pictures[0][1]);
+                                       $imgdata = Image::getInfoFromURL($pictures[0][1]);
                                        if (substr($imgdata["mime"], 0, 6) == "image/") {
                                                $post["type"] = "photo";
                                                $post["image"] = $pictures[0][1];
@@ -449,7 +448,7 @@ function plaintext(App $a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2
                        // Which purpose has this line? It is now uncommented, but left as a reminder
                        //} elseif (strpos($b["body"], "[share") !== false) {
                        //      $post["url"] = $b["plink"];
-                       } elseif (get_pconfig($b["uid"], "system", "no_intelligent_shortening")) {
+                       } elseif (PConfig::get($b["uid"], "system", "no_intelligent_shortening")) {
                                $post["url"] = $b["plink"];
                        }
                        $msg = shortenmsg($msg, $limit);