X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FParseUrl.php;h=9a3de88cf2ac789d5866edf28d41e35bdf6c412e;hb=6bb418c5a7cdd71d28a8a572059efb14401b70bd;hp=70c5279cc84a42ce9314a202375cb2f1382c6fd5;hpb=e447375cddb847edbc9d4486be3938674ae66b8c;p=friendica.git diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index 70c5279cc8..9a3de88cf2 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -8,11 +8,10 @@ namespace Friendica\Util; use DOMDocument; use DOMXPath; use Friendica\Content\OEmbed; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\Object\Image; -use Friendica\Util\Strings; /** * @brief Class with methods for extracting certain content from an url @@ -23,10 +22,10 @@ class ParseUrl * @brief Search for chached embeddable data of an url otherwise fetch it * * @param string $url The url of the page which should be scraped - * @param bool $no_guessing If true the parse doens't search for - * preview pictures - * @param bool $do_oembed The false option is used by the function fetch_oembed() - * to avoid endless loops + * @param bool $no_guessing If true the parse doens't search for + * preview pictures + * @param bool $do_oembed The false option is used by the function fetch_oembed() + * to avoid endless loops * * @return array which contains needed data for embedding * string 'url' => The url of the parsed page @@ -38,7 +37,8 @@ class ParseUrl * array'images' = Array of preview pictures * string 'keywords' => The tags which belong to the content * - * @see ParseUrl::getSiteinfo() for more information about scraping + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @see ParseUrl::getSiteinfo() for more information about scraping * embeddable content */ public static function getSiteinfoCached($url, $no_guessing = false, $do_oembed = true) @@ -69,6 +69,7 @@ class ParseUrl return $data; } + /** * @brief Parse a page for embeddable content information * @@ -80,11 +81,11 @@ class ParseUrl * \ * * @param string $url The url of the page which should be scraped - * @param bool $no_guessing If true the parse doens't search for - * preview pictures - * @param bool $do_oembed The false option is used by the function fetch_oembed() - * to avoid endless loops - * @param int $count Internal counter to avoid endless loops + * @param bool $no_guessing If true the parse doens't search for + * preview pictures + * @param bool $do_oembed The false option is used by the function fetch_oembed() + * to avoid endless loops + * @param int $count Internal counter to avoid endless loops * * @return array which contains needed data for embedding * string 'url' => The url of the parsed page @@ -96,7 +97,8 @@ class ParseUrl * array'images' = Array of preview pictures * string 'keywords' => The tags which belong to the content * - * @todo https://developers.google.com/+/plugins/snippet/ + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @todo https://developers.google.com/+/plugins/snippet/ * @verbatim * * @@ -111,8 +113,6 @@ class ParseUrl */ public static function getSiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) { - $a = \get_app(); - $siteinfo = []; // Check if the URL does contain a scheme @@ -422,7 +422,7 @@ class ParseUrl Logger::log('Siteinfo for ' . $url . ' ' . print_r($siteinfo, true), Logger::DEBUG); - Addon::callHooks('getsiteinfo', $siteinfo); + Hook::callAll('getsiteinfo', $siteinfo); return $siteinfo; }