Changeset 2375

Show
Ignore:
Timestamp:
03/28/2008 05:31:41 PM (8 months ago)
Author:
Geert
Message:

Fixed text::auto_link_urls() to also work on naked "www.domain.co.uk" URLs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/text.php

    r2373 r2375  
    245245 
    246246                // Find all naked www.links.com (without http://) 
    247                 if (preg_match_all('~\b(?<!://)www\.[a-z][-a-z0-9]*+\.[a-z]{2,6}\b~i', $text, $matches)) 
     247                if (preg_match_all('~\b(?<!://)www(?:\.[a-z0-9][-a-z0-9]*+)+\.[a-z]{2,6}\b~i', $text, $matches)) 
    248248                { 
    249249                        foreach ($matches[0] as $match)