WordPress.org

Make WordPress Core

Changeset 18804


Ignore:
Timestamp:
09/29/11 00:34:24 (3 years ago)
Author:
azaozz
Message:

Convert html entities in script localization strings, see #11520

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class.wp-scripts.php

    r18498 r18804  
    6363                unset($data['l10n_print_after']); 
    6464            } 
    65             $output = "var $name = " . json_encode($data) . "; $after\n"; 
     65            $output = "var $name = " . json_encode( html_entity_decode($data, ENT_QUOTES, 'UTF-8') ) . "; $after\n"; 
    6666        } else { 
    6767            $data = $this->get_data( $handle, 'data' ); 
     
    7171 
    7272            foreach ( (array) $data as $name => $data ) { 
    73                 $output = "var $name = " . json_encode($data) . ";\n"; 
     73                $output = "var $name = " . json_encode( html_entity_decode($data, ENT_QUOTES, 'UTF-8') ) . ";\n"; 
    7474            } 
    7575        } 
Note: See TracChangeset for help on using the changeset viewer.