Hi,

I've been able to add facebook, twitter and flickr to the follow module but when I try last.fm it says my url is invalid. I have checked the url so many times but no joy. I think the module doesn't like the .fm in the url.

Please help.

Comments

q0rban’s picture

Status: Active » Postponed (maintainer needs more info)

Hi, I'm sorry you are having troubles.

I can't replicate this. Can you paste the url here that you are unable to use? Thanks!

neo2049’s picture

The URL I am trying is http://www.last.fm/music/Musica+Reverso

Thanks for your help.

q0rban’s picture

hmm, I imagine it's the plus symbol actually. Try http://www.last.fm/music/Musica%2BReverso

neo2049’s picture

Thanks man! It works perfectly now.

q0rban’s picture

Status: Postponed (maintainer needs more info) » Active

I'm going to keep this active in case it continues to be a problem for other people.

q0rban’s picture

Priority: Critical » Normal

Bumping down to normal

q0rban’s picture

Title: I'm unable to add last.fm » Refactor regex to allow for special chars in urls
Assigned: neo2049 » q0rban
Category: bug » task
pwolanin’s picture

Title: Refactor regex to allow for special chars in urls » Refactor regex for better validation and to allow for special chars in urls
Version: 6.x-1.2 » 7.x-1.x-dev

started working on this for D7, adding knwn service urls to build better validation

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new2.48 KB

here's a pass at a D7 patch, not really tested yet.

pwolanin’s picture

picking up the suggestion here: http://drupal.org/node/619276#comment-2218064 for a more complex data structure to help with validation and display

pwolanin’s picture

StatusFileSize
new5.8 KB
pwolanin’s picture

StatusFileSize
new6.31 KB

fixes a bug with the user block theme function call also.

pwolanin’s picture

StatusFileSize
new6.59 KB

remove debug code, improve error message.

pwolanin’s picture

Allowing special characters is hard, since there is only a single text area. Basically to do it correctly we need to parse the URL on input and store the parts separately in the DB. I think drupal core is doing something like this in the menu module.

I'm planning to commit the above patch, since solving the other concern seems liek a more substantial problem that at first sight.

q0rban’s picture

Marked #622118: Follow doesn't accept valid Flickr link dues to @ symbol as a duplicate of this issue.

Also, anyone that is having trouble with special characters can refer to this doc and convert the special characters by hand.

@pwolanin, is there any way to parse out the url and pass all fragments to urlencode?

pwolanin’s picture

@q0rban - yes, see: http://api.drupal.org/api/function/menu_edit_item_validate/7

but then I'd suggest the DB storage needs to change. In fact the module should not even need to urlencode anything if using the l() function properly due to http://api.drupal.org/api/function/drupal_http_build_query/7

q0rban’s picture

Ok, then I think the only thing the regex needs to do is make sure it has the domain in the url. Then we still need to somehow filter for XSS before saving to the DB, correct?

pwolanin’s picture

@q0rban - no, l() should filter this on output, so using that well will make everything both easier and more robust. In fact, if we are going to parse the URL, likely we can make the regex simpler.

We will essentially need to save to the DB 2 possible ways:

1) a path + serialized options array as 2 columns
2) a path, query, and fragment columns (query sill likely as a serialized array)

q0rban’s picture

Hmm... I'm going to have to think about this.. Off the bat I'm not crazy about parsing it and saving it to the DB that way.

pwolanin’s picture

@q0rban - well that's how drupal core saves links - what's the downside?

pwolanin’s picture

pwolanin’s picture

StatusFileSize
new12.61 KB
pwolanin’s picture

could also look at using http://api.drupal.org/api/function/drupal_parse_url/7, but that's not as readily backported to 6.x

pwolanin’s picture

StatusFileSize
new13.42 KB

Minor tweaks to regex generation and help/error text. About ready to commit this.

pwolanin’s picture

Status: Needs review » Fixed
pwolanin’s picture

StatusFileSize
new642 bytes

opps - broke a clean install. Follow-up patch to fix this - committing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

seanr’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Closed (fixed) » Active

This is still not fixed in follow-6.x-1.4. It's not fixed in the dev branch either and it's been a year and a half.

seanr’s picture

Specifically, the issue in question is #622118: Follow doesn't accept valid Flickr link dues to @ symbol which was marked as a duplicate of this one. This one was marked as fixed, but it clearly isn't (at least in 6.x).

q0rban’s picture

It's still not fixed in 6.x-1.x-dev? Can you give me steps to replicate in 6.x-1.x-dev?

astonvictor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks