diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-03-29 21:30:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 21:30:04 +0300 |
commit | b848f3bfd449f03041eaffe1cd4b4151e65990f1 (patch) | |
tree | 709f58d18d6967c52210d9878038dd5843988cff /lib/Service | |
parent | 7a51a14e9f04c993b664cb5b4fe673fe75258b14 (diff) | |
parent | 4c2354f67dc90e9ad254fbcfe070cf3e35dbc5e0 (diff) |
Merge pull request #4836 from nextcloud/techdept/urllinker-fork
Replace abandoned kwi urllinker with a maintained fork
Diffstat (limited to 'lib/Service')
-rwxr-xr-x | lib/Service/Html.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Service/Html.php b/lib/Service/Html.php index 29e32e628..7983b35d3 100755 --- a/lib/Service/Html.php +++ b/lib/Service/Html.php @@ -33,7 +33,6 @@ use HTMLPurifier_Config; use HTMLPurifier_HTMLDefinition; use HTMLPurifier_URIDefinition; use HTMLPurifier_URISchemeRegistry; -use Kwi\UrlLinker; use OCA\Mail\Service\HtmlPurify\CidURIScheme; use OCA\Mail\Service\HtmlPurify\TransformCSSBackground; use OCA\Mail\Service\HtmlPurify\TransformHTMLLinks; @@ -43,6 +42,7 @@ use OCA\Mail\Service\HtmlPurify\TransformURLScheme; use OCP\IRequest; use OCP\IURLGenerator; use OCP\Util; +use Youthweb\UrlLinker\UrlLinker; require_once __DIR__ . '/../../vendor/cerdic/css-tidy/class.csstidy.php'; @@ -64,7 +64,10 @@ class Html { * @return string */ public function convertLinks(string $data): string { - $linker = new UrlLinker(true, false); + $linker = new UrlLinker([ + 'allowFtpAddresses' => true, + 'allowUpperCaseUrlSchemes' => false, + ]); $data = $linker->linkUrlsAndEscapeHtml($data); $config = HTMLPurifier_Config::createDefault(); |