summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2019-10-11 16:12:38 +0200
committerCyrille Bollu <cyrpub@bollu.be>2019-10-11 16:12:38 +0200
commit264afab54e0424f85e40ae7dfe4d5dfb3ec31ffc (patch)
tree0f1e6cfe04c3886f5406db1dae00624d78650827
parent935f844a93c95b22cd97d23dda0cd1eb9d02cd4d (diff)
IMPROVEMENT: URLs now need to have a leading protocol to create a link.
(https://www.nextcloud.com will create a link while www.nextcloud.com won't) Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
-rw-r--r--src/components/TimelinePost.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/TimelinePost.vue b/src/components/TimelinePost.vue
index 88a16f44..5fbdc74a 100644
--- a/src/components/TimelinePost.vue
+++ b/src/components/TimelinePost.vue
@@ -110,6 +110,11 @@ export default {
return ''
}
message = message.linkify({
+ validate: {
+ url: function(value) {
+ return /^(http|ftp)s?:\/\//.test(value)
+ }
+ },
formatHref: {
mention: function(href) {
return OC.generateUrl('/apps/social/@' + href.substring(1))