[wp-trac] Re: [WordPress Trac] #2889: duplicate content when submitting comments

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 5 13:02:56 GMT 2006


#2889: duplicate content when submitting comments
---------------------------------------------------------------------+------
 Reporter:  whooami                                                  |        Owner:  anonymous
     Type:  defect                                                   |       Status:  new      
 Priority:  high                                                     |    Milestone:  2.0.4    
Component:  General                                                  |      Version:  2.0.3    
 Severity:  normal                                                   |   Resolution:           
 Keywords:  comment, function, anchor, make_clickable, bg|has_patch  |  
---------------------------------------------------------------------+------
Comment (by whooami):

 This has the same effect:


 {{{
 $ret = preg_replace("#(^|[\s>])(https?)://([^<>{}\s]+[^.,<>{}\s])#i",
 "$1<a href='$2://$3' rel='nofollow'>$2://$3</a>", $ret);
 $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is",
 "\\1<a href=\"\\2\" rel=\"nofollow\">\\2</a>", $ret);
 $ret = preg_replace("#(^|[\n
 ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\"
 rel=\"nofollow\">\\2</a>", $ret);
 }}}


 The effect being that yes, they both fix the http:// problem but they
 introduce another problem: regular urls such as :

 {{{

 http://www.village-idiot.org
 }}}
 are no longer made clickable when not enclosed in tags.

 I spose thats the tradeoff? or did you update that code in the time I took
 to type this?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2889>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list