Skip to content

Commit

Permalink
Only pass hostname to Idna decode method
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Mar 3, 2015
1 parent 5a07bd4 commit 375e027
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion framework/Text_Filter/lib/Horde/Text/Filter/Linkurls.php
Expand Up @@ -149,7 +149,14 @@ public function callback($match)
}

try {
$decoded = Horde_Idna::decode($orig_href);
if (strlen($host = @parse_url($orig_href, PHP_URL_HOST))) {
$decoded = substr_replace(
$orig_href,
Horde_Idna::decode($host),
strpos($orig_href, $host),
strlen($host)
);
}
} catch (Horde_Idna_Exception $e) {}

$replacement = '<a href="' . $href . '"' .
Expand Down

0 comments on commit 375e027

Please sign in to comment.