Changeset 5247


Ignore:
Timestamp:
12/13/11 13:05:27 (12 years ago)
Author:
cristiano
Message:

Ticket #2378 - Links sem o http em mensagens criadas no ExpressoMail?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r5243 r5247  
    19271927        function replace_links_callback($matches)   
    19281928        { 
    1929                 if($matches[3])  
    1930                         $pref = $matches[3];  
    1931             else  
    1932                         $pref = $matches[3] = 'http';  
    1933  
    1934             return '<a href="'.$pref.'://'.$matches[4].$matches[5].'" target="_blank">'.$matches[4].$matches[5].'</a>';  
     1929            if($matches[3])  
     1930                    $pref = $matches[3];  
     1931            else  
     1932                    $pref = $matches[3] = 'http';  
     1933 
     1934            return '<a href="'.$pref.'://'.$matches[4].$matches[5].'" target="_blank">'.$matches[0].'</a>';  
    19351935        }  
    19361936 
     
    19421942        */ 
    19431943        function replace_links(&$body) 
    1944                 {  
     1944        {  
    19451945                // Trata urls do tipo aaaa.bbb.empresa   
    19461946                // Usadas na intranet.   
    1947                 $pattern = '/(?<=[\s|(<br>)|\n|\r|;])(((http|https|ftp|ftps)?:\/\/((?:[\w]\.?)+(?::[\d]+)?[:\/.\-~&=?%;@#,+\w]*))|((?:www?\.)(?:\w\.?)*(?::\d+)?[\:\/\w.\-~&=?%;@+]*))/i';      
    1948                 $replacement = '<a href="://$4$5" target="_blank">$4$5</a>';  
    1949             $body = preg_replace_callback($pattern,array( &$this, 'replace_links_callback'), $body); 
     1947                $pattern = '/(?<=[\s|(<br>)|\n|\r|;])(((http|https|ftp|ftps)?:\/\/((?:[\w]\.?)+(?::[\d]+)?[:\/.\-~&=?%;@#,+\w]*))|((?:www?\.)(?:\w\.?)*(?::\d+)?[\:\/\w.\-~&=?%;@+]*))/i';    
     1948                $body = preg_replace_callback($pattern,array( &$this, 'replace_links_callback'), $body); 
    19501949 
    19511950        } 
Note: See TracChangeset for help on using the changeset viewer.