X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Fparse_url.php;h=6fb404f1b052f9714d9afb9ff2f62c87872570b0;hb=391c5913227c7f62f19b4f08906b0b1b0b618b33;hp=44cf80935e2bd237aa437a55969c82c1f2823c84;hpb=4dce3d822470537e40a0f77330d62ac05bf73806;p=friendica.git diff --git a/mod/parse_url.php b/mod/parse_url.php index 44cf80935e..6fb404f1b0 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -1,36 +1,27 @@ "); + $br = "\n"; if (x($_GET,"binurl")) { $url = trim(hex2bin($_GET["binurl"])); @@ -69,10 +60,10 @@ function parse_url_content(App &$a) { // the URL with the corresponding BBCode media tag $redirects = 0; // Fetch the header of the URL - $result = z_fetch_url($url, false, $redirects, array("novalidate" => true, "nobody" => true)); + $result = z_fetch_url($url, false, $redirects, ["novalidate" => true, "nobody" => true]); if($result["success"]) { // Convert the header fields into an array - $hdrs = array(); + $hdrs = []; $h = explode("\n", $result["header"]); foreach ($h as $l) { list($k,$v) = array_map("trim", explode(":", trim($l), 2)); @@ -97,15 +88,11 @@ function parse_url_content(App &$a) { } } - if ($textmode) { - $template = "[bookmark=%s]%s[/bookmark]%s"; - } else { - $template = "%s%s"; - } + $template = "[bookmark=%s]%s[/bookmark]%s"; - $arr = array("url" => $url, "text" => ""); + $arr = ["url" => $url, "text" => ""]; - call_hooks("parse_link", $arr); + Addon::callHooks("parse_link", $arr); if (strlen($arr["text"])) { echo $arr["text"]; @@ -116,14 +103,9 @@ function parse_url_content(App &$a) { // need to parse the url for content. if ($url && $title && $text) { - $title = str_replace(array("\r","\n"),array("",""),$title); + $title = str_replace(["\r","\n"],["",""],$title); - if ($textmode) { - $text = "[quote]" . trim($text) . "[/quote]" . $br; - } else { - $text = "
" . htmlspecialchars(trim($text)) . "