* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
*/
use Friendica\App;
-use Friendica\Core\Addon;
+use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Util\Network;
use Friendica\Util\ParseUrl;
-require_once 'include/items.php';
-
function parse_url_content(App $a)
{
$text = null;
// Add url scheme if it is missing
$arrurl = parse_url($url);
- if (!x($arrurl, 'scheme')) {
- if (x($arrurl, 'host')) {
+ if (empty($arrurl['scheme'])) {
+ if (!empty($arrurl['host'])) {
$url = 'http:' . $url;
} else {
$url = 'http://' . $url;
$arr = ['url' => $url, 'text' => ''];
- Addon::callHooks('parse_link', $arr);
+ Hook::callAll('parse_link', $arr);
if (strlen($arr['text'])) {
echo $arr['text'];