]> git.mxchange.org Git - friendica.git/blobdiff - src/ParseUrl.php
Add Base Module class
[friendica.git] / src / ParseUrl.php
index 217ca25d9f05b6757eb53bfab7dfd44ad54b3df6..35557067d7474ca4d7d85d522c0b1847fc33977a 100644 (file)
@@ -6,15 +6,14 @@
 namespace Friendica;
 
 use Friendica\Core\Config;
+use Friendica\Object\Image;
+use Friendica\Util\XML;
 
-use xml;
 use dba;
-
 use DomXPath;
 use DOMDocument;
 
 require_once "include/network.php";
-require_once "include/Photo.php";
 require_once "include/oembed.php";
 
 /**
@@ -204,17 +203,17 @@ class ParseUrl
                $doc = new DOMDocument();
                @$doc->loadHTML($body);
 
-               xml::deleteNode($doc, "style");
-               xml::deleteNode($doc, "script");
-               xml::deleteNode($doc, "option");
-               xml::deleteNode($doc, "h1");
-               xml::deleteNode($doc, "h2");
-               xml::deleteNode($doc, "h3");
-               xml::deleteNode($doc, "h4");
-               xml::deleteNode($doc, "h5");
-               xml::deleteNode($doc, "h6");
-               xml::deleteNode($doc, "ol");
-               xml::deleteNode($doc, "ul");
+               XML::deleteNode($doc, "style");
+               XML::deleteNode($doc, "script");
+               XML::deleteNode($doc, "option");
+               XML::deleteNode($doc, "h1");
+               XML::deleteNode($doc, "h2");
+               XML::deleteNode($doc, "h3");
+               XML::deleteNode($doc, "h4");
+               XML::deleteNode($doc, "h5");
+               XML::deleteNode($doc, "h6");
+               XML::deleteNode($doc, "ol");
+               XML::deleteNode($doc, "ul");
 
                $xpath = new DomXPath($doc);
 
@@ -354,7 +353,7 @@ class ParseUrl
                                }
 
                                $src = self::completeUrl($attr["src"], $url);
-                               $photodata = get_photo_info($src);
+                               $photodata = Image::getInfoFromURL($src);
 
                                if (($photodata) && ($photodata[0] > 150) && ($photodata[1] > 150)) {
                                        if ($photodata[0] > 300) {
@@ -375,7 +374,7 @@ class ParseUrl
 
                        unset($siteinfo["image"]);
 
-                       $photodata = get_photo_info($src);
+                       $photodata = Image::getInfoFromURL($src);
 
                        if (($photodata) && ($photodata[0] > 10) && ($photodata[1] > 10)) {
                                $siteinfo["images"][] = array("src" => $src,
@@ -455,6 +454,7 @@ class ParseUrl
         *
         * @param string $tag The pure tag name
         * @param int    $k   Counter for internal use
+        * @return void
         */
        private static function arrAddHashes(&$tag, $k)
        {