root

Changeset 394

Show
Ignore:
Timestamp:
11/14/08 21:53:32 (2 years ago)
Author:
wbond
Message:

Updated all functions that deal with entities to use ENT_QUOTES and made sure they all specify 'UTF-8'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fCore.php

    r388 r394 Hide Line Numbers
    510510    static public function expose($data) 
    511511    { 
    512         echo '<pre class="exposed">' . htmlspecialchars((string) self::dump($data)) . '</pre>'; 
     512        echo '<pre class="exposed">' . htmlspecialchars((string) self::dump($data), ENT_QUOTES, 'UTF-8') . '</pre>'; 
    513513    } 
    514514     
  • fHTML.php

    r316 r394 Hide Line Numbers
    6363    static public function decode($content) 
    6464    { 
    65         return html_entity_decode($content, ENT_COMPAT, 'UTF-8'); 
     65        return html_entity_decode($content, ENT_QUOTES, 'UTF-8'); 
    6666    } 
    6767     
     
    7575    static public function encode($content) 
    7676    { 
    77         return htmlentities($content, ENT_COMPAT, 'UTF-8'); 
     77        return htmlentities($content, ENT_QUOTES, 'UTF-8'); 
    7878    } 
    7979     
     
    161161        // For each chunk of text, make sure it is converted to entities 
    162162        foreach($text_matches as $key => $value) { 
    163             $text_matches[$key] = htmlspecialchars($value); 
     163            $text_matches[$key] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); 
    164164        } 
    165165         
  • fPrintableException.php

    r391 r394 Hide Line Numbers
    265265        $no_block_html = strip_tags($content, $inline_tags) == $content; 
    266266         
    267         $content = html_entity_decode($content, ENT_COMPAT, 'UTF-8'); 
     267        $content = html_entity_decode($content, ENT_QUOTES, 'UTF-8'); 
    268268         
    269269        // This code ensures the output is properly encoded for display in (X)HTML, extracted from fHTML to reduce dependencies 
     
    273273         
    274274        foreach($text_matches as $key => $value) { 
    275             $value = htmlspecialchars($value); 
     275            $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); 
    276276        } 
    277277         
  • fXML.php

    r321 r394 Hide Line Numbers
    3131    static public function encode($content) 
    3232    { 
    33         return htmlspecialchars(html_entity_decode($content, ENT_COMPAT, 'UTF-8')); 
     33        return htmlspecialchars(html_entity_decode($content, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); 
    3434    } 
    3535