alecpl
2009-01-21 755900cd6aef3e9808dfd76c797904a2c8b08bed
- Fix html entities replacement (related to r2186)


1 files modified
5 ■■■■■ changed files
program/lib/html2text.php 5 ●●●●● patch | view | raw | blame | history
program/lib/html2text.php
@@ -176,7 +176,6 @@
        '/&(bull|#149|#8226);/i',                // Bullet
        '/&(pound|#163);/i',                     // Pound sign
        '/&(euro|#8364);/i',                     // Euro sign
        '/&[^&;]+;/i',                           // Unknown/unhandled entities
        '/[ ]{2,}/'                              // Runs of spaces, post-handling
    );
@@ -220,7 +219,6 @@
        '*',
        '£',
        'EUR',                                  // Euro sign. € ?
        '',                                     // Unknown/unhandled entities
        ' '                                     // Runs of spaces, post-handling
    );
@@ -475,6 +473,9 @@
    // Replace known html entities
    $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
        // Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
        $text = preg_replace('/&[^&;]+;/i', '', $text);
        // Strip any other HTML tags
        $text = strip_tags($text, $this->allowed_tags);