cgaspard / mantiskanban

Mantis Kanban that uses ajax and mantisconnect
45 stars 33 forks source link

Hosting Mantis on HTTPS gives wrong href links in edit view #51

Open kjean667 opened 8 years ago

kjean667 commented 8 years ago

When hosting Mantis on a HTTPS server and configuring the ServerHostName in config.js as Mantis.ServerHostname = "https://my.host/mantis", the title link into Mantis for an issue shown in the "View Issue" right side popup are wrong.

The edit-story-title HTML item will show a faulty href to "https//my.host/mantis" (tested in Firefox).

A fix for the problem would be changing line 1009 in kanban.js from:

document.getElementById("edit-story-title").innerHTML = "<a target=\"_new\" href=http://" + Mantis.ServerHostname + "/view.php?id=" + thisStory.ID + ">"+ thisStory.ID + "</a> &nbsp; " + (thisStory.Summary.length > 40 ? thisStory.Summary.substring(0, 37) + "..." : thisStory.Summary);

to:

document.getElementById("edit-story-title").innerHTML = "<a target=\"_new\" href=" + Mantis.ServerHostname + "/view.php?id=" + thisStory.ID + ">"+ thisStory.ID + "</a> &nbsp; " + (thisStory.Summary.length > 40 ? thisStory.Summary.substring(0, 37) + "..." : thisStory.Summary);

The "http://" has been removed from target since it is specified by the Mantis.ServerHostname .