From a392235e23c3b8af1d0eba4dbac18b18de826a1c Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Sun, 28 Aug 2022 20:54:21 +0200 Subject: Cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/public/IURLGenerator.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/public/IURLGenerator.php') diff --git a/lib/public/IURLGenerator.php b/lib/public/IURLGenerator.php index 580536b8b5f..808ba66c862 100644 --- a/lib/public/IURLGenerator.php +++ b/lib/public/IURLGenerator.php @@ -35,6 +35,16 @@ namespace OCP; * @since 6.0.0 */ interface IURLGenerator { + + /** + * Regex for matching http(s) urls + * + * 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 = '/(\s|\n|^)(https?:\/\/)?((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi'; + /** * Returns the URL for a route * @param string $routeName the name of the route -- cgit v1.2.3