diff options
Diffstat (limited to 'lib/public/IURLGenerator.php')
-rw-r--r-- | lib/public/IURLGenerator.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/public/IURLGenerator.php b/lib/public/IURLGenerator.php index 8229d51f231..396867e22b3 100644 --- a/lib/public/IURLGenerator.php +++ b/lib/public/IURLGenerator.php @@ -41,6 +41,7 @@ interface IURLGenerator { * 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 + * @since 29.0.0 changed to match localhost and hostnames with ports */ public const URL_REGEX = '/' . self::URL_REGEX_NO_MODIFIERS . '/mi'; @@ -50,8 +51,9 @@ interface IURLGenerator { * 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 + * @since 29.0.0 changed to match localhost and hostnames with ports */ - public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; + public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; /** * Returns the URL for a route @@ -95,6 +97,7 @@ interface IURLGenerator { * @param string $appName the name of the app * @param string $file the name of the file * @return string the url + * @throws \RuntimeException If the image does not exist * @since 6.0.0 */ public function imagePath(string $appName, string $file): string; |