Skip to content

Commit 474dcf0

Browse files
committed
Only match http(s) URLs for references
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent a880f79 commit 474dcf0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

core/src/OCP/comments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import $ from 'jquery'
3434
*
3535
* This is a copy of the backend regex in IURLGenerator, make sure to adjust both when changing
3636
*/
37-
const urlRegex = /(\s|^)(https?:\/\/)?((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig
37+
const urlRegex = /(\s|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig
3838

3939
/**
4040
* @param {any} content -

dist/core-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/public/IURLGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ interface IURLGenerator {
4343
*
4444
* @since 25.0.0
4545
*/
46-
public const URL_REGEX = '/(\s|\n|^)(https?:\/\/)?((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi';
46+
public const URL_REGEX = '/(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi';
4747

4848
/**
4949
* Returns the URL for a route

0 commit comments

Comments
 (0)