AnsweredAssumed Answered

Links containing http:// fail due to extra http//

Question asked by jtp on Mar 2, 2009
Latest reply on Mar 3, 2009 by mikeh
I realize that's a heck of a title, but I'll explain.

1)  Create a link such as http://www.alfresco.com
2)  If you click on that link while it is in the list of all links, it works.
3)  Instead, click on the title so you reach the page where you could comment on the link.
4)  Now click on the URL; the link will look like http://http//www.alfresco.com

I believe it has to do with this section of code in
C:\Alfresco\tomcat\webapps\share\components\links\linksview.js
but I'm not sure how it works.

         // Link details
         html += '<div class="nodeContent">';
         html += '<div class="nodeTitle"><a href="' + linksViewUrl + '">' + $html(data.title) + '</a></div>';

         html += '<div class="nodeURL">';
         html += '<span class="nodeAttrLabel">' + this._msg("link.url") + ": </span><a " + (data.internal ? "" : "target='_blank' class='external'") + " href='" + (data.url.substring(0, 1) != '/' || data.url.indexOf("://") == -1 ? 'http://' : '') + data.url + "'>" + $html(data.url) + '</a>';
         html += '</div>';

Did I find something new or am I just crazy?

Outcomes