Development

Changeset 7900

You must first sign up to be able to contribute.

Changeset 7900

Show
Ignore:
Timestamp:
03/15/08 13:34:54 (6 months ago)
Author:
fabien
Message:

fixed some htmlspecialchars() calls (added the current charset)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/addon/propel/sfPropelDatabaseSchema.class.php

    r5749 r7900  
    331331        if (!in_array($key, array('foreignTable', 'foreignReference', 'onDelete', 'onUpdate', 'index', 'unique'))) 
    332332        { 
    333           $attributes_string .= " $key=\"".htmlspecialchars($this->getCorrectValueFor($key, $value))."\""; 
     333          $attributes_string .= " $key=\"".htmlspecialchars($this->getCorrectValueFor($key, $value), ENT_QUOTES, sfConfig::get('sf_charset'))."\""; 
    334334        } 
    335335      } 
     
    395395    foreach ($attributes as $key => $value) 
    396396    { 
    397       $attributes_string .= ' '.$key.'="'.htmlspecialchars($this->getCorrectValueFor($key, $value)).'"'; 
     397      $attributes_string .= ' '.$key.'="'.htmlspecialchars($this->getCorrectValueFor($key, $value), ENT_QUOTES, sfConfig::get('sf_charset')).'"'; 
    398398    } 
    399399 
  • branches/1.0/lib/helper/TagHelper.php

    r3336 r7900  
    7272function escape_once($html) 
    7373{ 
    74   return fix_double_escape(htmlspecialchars($html)); 
     74  return fix_double_escape(htmlspecialchars($html, ENT_QUOTES, sfConfig::get('sf_charset'))); 
    7575} 
    7676 
  • branches/1.0/test/unit/helper/TagHelperTest.php

    r3163 r7900  
    6262// fix_double_escape() 
    6363$t->diag('fix_double_escape()'); 
    64 $t->is(fix_double_escape(htmlspecialchars(htmlspecialchars('This a > text to "escape"'))), 'This a > text to "escape"', 'fix_double_escape() fixes double escaped strings'); 
     64$t->is(fix_double_escape(htmlspecialchars(htmlspecialchars('This a > text to "escape"'), ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'), 'This a > text to "escape"', 'fix_double_escape() fixes double escaped strings');