Skip to content

Commit

Permalink
[FIX] website_forum: allow to submit link
Browse files Browse the repository at this point in the history
Fix/Simplify previous regex that was wrong (eg: http:// instead of http:\/\/)
  • Loading branch information
JKE-be committed Feb 14, 2018
1 parent b7b82f1 commit 2d0bcce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/website_forum/static/src/js/website_forum.js
Expand Up @@ -223,7 +223,7 @@ if(!$('.website_forum').length) {
if (url.search("^http(s?)://.*")) {
url = 'http://'+url;
}
var regex = new RegExp("(http(s)?://.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)");
var regex = new RegExp("^(http(s?):\/\/).*[\.]+.*");
if(regex.test(url)){
ajax.jsonRpc("/forum/get_url_title", 'call', {'url': url}).then(function (data) {
if (data) {
Expand Down

0 comments on commit 2d0bcce

Please sign in to comment.