diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-10-03 18:23:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 18:23:21 +0200 |
commit | f888f99b0a4f599ea403cdf337935093c5420586 (patch) | |
tree | a112c76282641ac1a02e8f2956a6d76f9e620d7f /lib/public | |
parent | 586d031a530a39214ddf16c7f27b27c7a23dc584 (diff) | |
parent | d434da75bb872e19c26839b5a73c022b1ba956e0 (diff) | |
download | nextcloud-server-f888f99b0a4f599ea403cdf337935093c5420586.tar.gz nextcloud-server-f888f99b0a4f599ea403cdf337935093c5420586.zip |
Merge pull request #34350 from nextcloud/bugfix/34278/add-capability-for-the-reference-api
Add a capability for the reference API and expose the regex to clients
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/IURLGenerator.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/public/IURLGenerator.php b/lib/public/IURLGenerator.php index be0edf61025..b6d78876478 100644 --- a/lib/public/IURLGenerator.php +++ b/lib/public/IURLGenerator.php @@ -43,7 +43,16 @@ interface IURLGenerator { * * @since 25.0.0 */ - public const URL_REGEX = '/(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi'; + public const URL_REGEX = '/' . self::URL_REGEX_NO_MODIFIERS . '/mi'; + + /** + * Regex for matching http(s) urls (without modifiers for client compatibility) + * + * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing + * + * @since 25.0.0 + */ + public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; /** * Returns the URL for a route |