mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-21 21:11:51 +00:00
Use a more explicit URL regex to allow commas in a URL
This commit is contained in:
parent
cd60294ada
commit
726aa3e070
@ -33,7 +33,8 @@ class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector
|
|||||||
|
|
||||||
// there is/are URL(s). Let's split the string:
|
// there is/are URL(s). Let's split the string:
|
||||||
// Note: this regex is extremely permissive
|
// Note: this regex is extremely permissive
|
||||||
$bits = preg_split('#((?:https?|ftp)://[^\s\'",<>()]+)#Su', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE);
|
// $bits = preg_split('#((?:https?|ftp)://[^\s\'",<>()]+)#Su', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
$bits = preg_split('#((?:https?|ftp)://\S+(?!(?<=[,\'")}>\]])\s?))#Su', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
|
||||||
|
|
||||||
$token = array();
|
$token = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user