Save allowed path/qstring/fragment characters in constants

This commit is contained in:
Mikael Nordfeldth
2016-03-09 14:51:52 +01:00
parent 723b49a22a
commit d179afa303
2 changed files with 7 additions and 3 deletions

View File

@@ -1013,9 +1013,9 @@ function common_replace_urls_callback($text, $callback, $arg = null) {
')'.
'(?:'.
'(?:\:\d+)?'. //:port
'(?:/[\pN\pL$\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'@]*)?'. // /path
'(?:\?[\pN\pL\$\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'@\/]*)?'. // ?query string
'(?:\#[\pN\pL$\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\*\$\+\'\@/\?\#]*)?'. // #fragment
'(?:/[' . URL_REGEX_VALID_PATH_CHARS . ']*)?'. // path
'(?:\?[' . URL_REGEX_VALID_QSTRING_CHARS . ']*)?'. // ?query string
'(?:\#[' . URL_REGEX_VALID_FRAGMENT_CHARS . ']*)?'. // #fragment
')(?<![\?\.\,\#\,])'.
')'.
'#ixu';