Browse Source

Only match http(s) URLs for references

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/34322/head
Joas Schilling 3 years ago
parent
commit
474dcf05fd
No known key found for this signature in database GPG Key ID: C400AAF20C1BB6FC
  1. 2
      core/src/OCP/comments.js
  2. 4
      dist/core-main.js
  3. 2
      dist/core-main.js.map
  4. 2
      lib/public/IURLGenerator.php

2
core/src/OCP/comments.js

@ -34,7 +34,7 @@ import $ from 'jquery'
*
* This is a copy of the backend regex in IURLGenerator, make sure to adjust both when changing
*/
const urlRegex = /(\s|^)(https?:\/\/)?((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig
const urlRegex = /(\s|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig
/**
* @param {any} content -

4
dist/core-main.js
File diff suppressed because it is too large
View File

2
dist/core-main.js.map
File diff suppressed because it is too large
View File

2
lib/public/IURLGenerator.php

@ -43,7 +43,7 @@ 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 = '/(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi';
/**
* Returns the URL for a route

Loading…
Cancel
Save