Development

Changeset 1429

You must first sign up to be able to contribute.

Changeset 1429

Show
Ignore:
Timestamp:
06/13/06 13:54:30 (2 years ago)
Author:
fabien
Message:

Prevent ESC_ENTITIES from losing variable type information (closes #623, #590 - patch from Mike Squire)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/helper/EscapingHelper.php

    r1415 r1429  
    4040function esc_entities($value) 
    4141{ 
    42   return htmlentities($value, ENT_QUOTES, 'UTF-8'); 
     42  // Numbers and boolean values get turned into strings which can cause problems 
     43  // with type comparisons (e.g. === or is_int() etc). 
     44  return is_string($value) ? htmlentities($value, ENT_QUOTES, 'UTF-8') : $value; 
    4345} 
    4446