When i use a quicklink, this module is proposing an invalid URL like 'index.phpuser/view'. Not sure what is intended here. I think the '?q=' is missing. There is a line in bookmarks_load_quicklink() which explicitly strips it.

Note that I have clean URLs disabled.

CommentFileSizeAuthor
#3 bookmarks_0.patch1.53 KBmatt westgate
#1 bookmarks.patch737 bytesmatt westgate

Comments

matt westgate’s picture

StatusFileSize
new737 bytes

Here is the fix.

gábor hojtsy’s picture

I am sure that this does not fix the complete issue.

The problem is that more GET parameters might be in the URL. That should bookmarked be reserved for some pages (ie. if you would like to bookmark a search results page), so they have the right to be there. Although one should note that the url is stored without the '?q=' substring, and when the links are printed, the stored links are used directly (so the ones without '?q='). This will not work with clean URLs disabled, especially not if this patch gets applied.

Then again this computer URL should not be used in the drupal_get_normal_path() call because of the extra parameters... Drupal provides the normal path in the 'q' key of $_GET AFAIK, so why not use it to find out the type of URLs for internal links?

matt westgate’s picture

Assigned: Unassigned » matt westgate
StatusFileSize
new1.53 KB

Yeah, It doesn't seem like it would work but I'm pretty sure it does.

For internal URLs, index.php?q= is stripped out for a couple of different reasons. Bookmarks would become invalid if the administrator were to change the way URLs work, such as enabling mod_rewrite or clean_urls. And like you mentioned, Drupal likes to deal with the canonical paths and not the index.php?q= fluff.

When an user's bookmarks are loaded, each one is evaluated and tagged either internal or external.

$url = (strstr($data->url, 'http://')) ? "<a href=\"$data->url\">$data->title</a>" : l($data->title, $data->url);

If it is an internal link, we let Drupal handle how the link needs to be built via l() which in turn calls url().

This new patch fixes the same URI problem in the delete function.

Anonymous’s picture

Ah, much better patch. You are right, I have interpreted your code wrongly :) BTW it will still break if an aliased URL is bookmarkd and the alias is removed, but we store the aliased version intentionaly, since exposing the non-alised version in bookmarks would look odd IMHO...

matt westgate’s picture

This has been fixed in CVS.

Anonymous’s picture