Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Bookmarks: don’t show protocol #393

wants to merge 2 commits into from

4 participants


Tried again to fix #144


Have a look @jancborchardt @eMerzh and let me know.


@eMerzh eMerzh was assigned

@raghunayyar @eMerzh quickly tested this and has some errors: When I try to add, say, »« or »« or any address without the protocol, the resulting bookmark will link to http://localhost/owncloud/index.php/apps/ and have »301 Moved Permanently« as the fetched title.


@jancborchardt I was getting this error even before I started fixing the protocol bug. The "301 Moved" on or I thought someone might be fixing it, I don't think it has got anything related to what I pushed. Please correct me if I am being wrong.



Can one of the admins verify this patch?


Hi Thanks for your PR,

the thing is that within a previous modifications we (you?) removed the URL from the bookmarks list.
So the #144 should be closed ...

and by the way, you patch only remove the protocol from the real links (used in the template) so when you click on a link you will always go to owncloud instead of the real site.

So I close this PR ;)

PS: jan, i've open another issue for the redirect part (which is not related to this code)

@eMerzh eMerzh closed this

@eMerzh it never went to ownCloud when I tested it for quite a many links. ;)
It's fine to close this bug anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 25, 2012
  1. @raghunayyar

    Bookmarks: don’t show protocol

    raghunayyar authored
    Protocols not shown in edit window or the heading.
  2. @raghunayyar

    Minor Indentation Error.

    raghunayyar authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 5 deletions.
  1. +6 −5 bookmarks/js/bookmarks.js
11 bookmarks/js/bookmarks.js
@@ -267,10 +267,12 @@ function updateBookmarksList(bookmark, position) {
if(tags[i] != '')
taglist = taglist + '<a class="bookmark_tag" href="#">' + encodeEntities(tags[i]) + '</a> ';
- if(!hasProtocol(bookmark.url)) {
- bookmark.url = 'http://' + bookmark.url;
- }
+ if (hasProtocol(bookmark.url)) {
+ var entry = /(https|http|ftp|sftp)/;
+ bookmark.url = bookmark.url.replace(entry, '');
+ bookmark.url = bookmark.url.replace('://', '');
+ }
if(bookmark.added) {
@@ -322,7 +324,7 @@ function encodeEntities(s){
function hasProtocol(url) {
var regexp = /(ftp|http|https|sftp)/;
- return regexp.test(url);
+ return regexp.test(url);
function renameTag(event) {
@@ -382,4 +384,3 @@ function deleteTag(event){
Something went wrong with that request. Please try again.