php-linkify icon indicating copy to clipboard operation
php-linkify copied to clipboard

Add an option to only linkify URLs that start with a scheme

Open hubgit opened this issue 8 years ago • 0 comments

Adding a require_scheme option allows a user to disable auto-linking of things that look like URLs (e.g. www.example.com), so that only full URLs (e.g. https://www.example.com) are auto-linked. The scheme currently has to match ~^(ht|f)tps?://~.

Example usage:

$html = $linkify->processUrls($html, [
  'require_scheme' => true
]);

hubgit avatar Dec 21 '16 15:12 hubgit