Changeset 2071


Ignore:
Timestamp:
02/25/10 12:13:51 (14 years ago)
Author:
rodsouza
Message:

Ticket #788 - Alteração devido a compatibilidade com o PHP nas versões 5.2.x e 5.3.

File:
1 edited

Legend:

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

    r2070 r2071  
    12261226                $pattern = "/(url\( *['\"]?|['\"@=])?{$url}/"; 
    12271227 
     1228                /* 
     1229                // PHP 5.3 
    12281230                $replace = function( $matches ) 
    12291231                { 
    1230                         //echo "\n--------------------------------------\n"; 
    1231                         //print_r( $matches ); 
    1232                         //return ''; 
    12331232                        if ( $matches[ 1 ] ) 
    12341233                                return $matches[ 0 ]; 
    12351234 
    1236                         //print_r( $matches ); 
    12371235                        $url = ( $matches[ 2 ] ) ? $matches[ 2 ] : 'http'; 
    12381236                        $url .= "{$matches[ 3 ]}://{$matches[ 4 ]}"; 
     
    12401238                }; 
    12411239                $body = preg_replace_callback( $pattern, $replace, $body ); 
     1240                */ 
     1241 
     1242                // PHP 5.2.x - Remover assim que possível 
     1243                $body = preg_replace_callback( $pattern, 
     1244                        create_function( 
     1245                                '$matches', 
     1246                                'if ( $matches[ 1 ] ) return $matches[ 0 ];' 
     1247                                        . '$url = ( $matches[ 2 ] ) ? $matches[ 2 ] : "http";' 
     1248                                        . '$url .= "{$matches[ 3 ]}://{$matches[ 4 ]}";' 
     1249                                        . 'return "<a href=\"{$url}\" target=\"_blank\">{$matches[ 4 ]}</a>";' 
     1250                        ), $body 
     1251                ); 
    12421252 
    12431253                // E-mail address in the text should create a new e-mail on ExpressoMail 
Note: See TracChangeset for help on using the changeset viewer.