Changeset 2248 in subversion


Ignore:
Timestamp:
Jan 21, 2009 2:55:09 AM (4 years ago)
Author:
alec
Message:
  • Fix html entities replacement (related to r2186)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/lib/html2text.php

    r2186 r2248  
    177177        '/&(pound|#163);/i',                     // Pound sign 
    178178        '/&(euro|#8364);/i',                     // Euro sign 
    179         '/&[^&;]+;/i',                           // Unknown/unhandled entities 
    180179        '/[ ]{2,}/'                              // Runs of spaces, post-handling 
    181180    ); 
     
    221220        '£', 
    222221        'EUR',                                  // Euro sign. € ? 
    223         '',                                     // Unknown/unhandled entities 
    224222        ' '                                     // Runs of spaces, post-handling 
    225223    ); 
     
    475473        // Replace known html entities 
    476474        $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8'); 
     475 
     476        // Remove unknown/unhandled entities (this cannot be done in search-and-replace block) 
     477        $text = preg_replace('/&[^&;]+;/i', '', $text);  
    477478 
    478479        // Strip any other HTML tags 
Note: See TracChangeset for help on using the changeset viewer.