1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-20 17:54:25 +01:00

Ensure that URL is always HTTP:// or HTTPS://

Conflicts:
	templates/js_tpl.php
This commit is contained in:
Lukas Reschke 2014-11-05 10:07:39 +01:00
parent 32c7b7e9ee
commit c775fc6c9f
2 changed files with 9 additions and 1 deletions

View File

@ -42,6 +42,14 @@ function watchClickInSetting(e){
toggleSettings();
}
}
function checkURL(url) {
if(url.substring(0, 3) === "htt") {
return url;
}
return "http://"+url;
}
function toggleSettings() {
if( $('#bookmark_settings').hasClass('open')) { //Close
$('#bookmark_settings').switchClass( "open", "" );

View File

@ -7,7 +7,7 @@
</span>&nbsp;
</p>
<p class="bookmark_title">
<a href="<&= encodeURI(url) &>" target="_blank" class="bookmark_link">
<a href="<&= checkURL(encodeURI(url)) &>" target="_blank" class="bookmark_link" rel="noreferrer">
<&= escapeHTML(title == '' ? encodeURI(url) : title ) &>
</a>
<span class="bookmark_edit bookmark_edit_btn">