my 1.15 version of urlfilter does not handle br's well. here are some tests:


www.yahoo.com

http://drupal.org


link here: http://www.google.com

here is the code i inputted:

<br>www.yahoo.com<br><br>

<br />http://drupal.org<br />

<br />link here: http://www.google.com<br />

Comments

beginner’s picture

+1
I just verified this here:
http://www.masquilier.org/drupal
http://www.masquilier.org/
The problem, too, is that we don't need to input the br, since the default filtered html filter does it for us.
When I inputed one url per line, the link wouldn't be created. Adding a blank space at the end, didn't help, so for sake of convenience, I currently cheat and added a blank space and a full stop so that it works(see page above).

--
http://www.wechange.org/

beginner’s picture

Hmm... It seems to work here: the input filter must be different.

Samo, where did you see you use 1.15 version? I have a cvs version from a week ago and the only mention of a version is in the CHANGELOG.txt, the topmost entry of which says:

urlfilter.module - January, 7th 2002

Here, we must manually enter the br html code for urlfilter to fail. on my new installation (cvs), it fails even when not explicitely entering br, i.e. when using the filtered html input filter.

 http://www.wechange.org/
 http://www.wechange.org/<br />

Here, one works, the other one no:
http://www.wechange.org/
http://www.wechange.org/
On my sites, when creating a node, both fail.

samo’s picture

The 1.15 version just refers to the CVS tag. Try a "cvs log urlfilter.module" or "cvs status urlfilter.module". 1.15 is a CVS tag from 2005-03-21.

I don't believe this has been fixed. Here are the same links I inputted to open this issue:


www.yahoo.com



http://drupal.org

link here: http://www.google.com

beginner’s picture

thank you samo for the info re: version.

I just found a related regex bug:

It seems that a + sign in an url doesn't work either.
I found this when working on this page:
http://www.wechange.org/book/positive_action/carfree_cities ,
The following url work:
http://www.wechange.org/taxonomy/term/43 ,
http://www.wechange.org/taxonomy/term/43,18 .
but not:
http://www.wechange.org/profile/profile_topics_of_interest/Carfree+Cities ,
http://www.wechange.org/profile/action_carfree_city/New+Orleans .

Which is a shame because the + sign is often used to link to specific taxonomy stuff...

I do some php coding, but my regex skills are inexistant...

adub’s picture

I cobbled something a bit messy together - does someone want to improve on this replacement (it doesn't allow + in url query for one thing). I've dropped it into urlfilter in 4.6.3 and it has solved the linebreak issue and allows urls starting with www. (ie. not http://) :


      // optimize any white space
      $text = preg_replace('~ +~',' ', $text);
      $text = preg_replace("~\t+~","\t", $text);
      $text = preg_replace("~\n+~","\n", $text);

      // urls
      $text = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i","$1http://$2", $text);
      $text = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i","<a target=\"_blank\" href=\"$1\">$1</a>", $text);

      // email
      $text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $text);

Steven’s picture

Status: Active » Fixed

None of these examples cause problems with the latest urlfilter.

friskya’s picture

Status: Fixed » Active

Actually, it doesn't seem to work with any content created by the flexinode module.

http://dachshund-rescue.org/node/118

The email address wasn't changed to a clickable link - same problem exists with URI's that have been used in the main body. (yes, the module was activated and configured)

drupal 4.7.2
urlfilter.module,v 1.18.2.5 2006/06/08 16:07:07

No later version found of the module

friskya’s picture

Whoops - found version 1.23 of the module (CVS version)

Still doesn't work with flexinode created content.

I've noticed a number of updates by Steven dated July 12, saying the problems reported have been fixed in "the latest version", however the dates on both 1.18 and 1.23 are June 8 (committed June 17)

IS there a later version for download?

Steven’s picture

Status: Active » Closed (fixed)

Try it with a regular story node. If it still doesn't work, then it's a urlfilter bug. Otherwise it's flexinode that is to blame.

PS: When I said the issues were fixed in the latest version, I was simply going over old issues and closing them.