Changeset 18813
- Timestamp:
- 09/29/2011 06:43:46 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class.wp-scripts.php
r18810 r18813 63 63 unset($data['l10n_print_after']); 64 64 } 65 $output = "var $name = " . json_encode($data) . "; $after\n"; 65 66 $data = $this->decode_html_entities($data); 67 $output = "var $name = " . json_encode( $data ) . "; $after\n"; 66 68 } else { 67 69 $data = $this->get_data( $handle, 'data' ); … … 70 72 return false; 71 73 72 foreach ( (array) $data as $name => $data ) { 73 $output = "var $name = " . json_encode($data) . ";\n"; 74 foreach ( (array) $data as $name => $value ) { 75 $value = $this->decode_html_entities($value); 76 $output = "var $name = " . json_encode( $value ) . ";\n"; 74 77 } 75 78 } … … 217 220 } 218 221 222 function decode_html_entities($data) { 223 foreach ( (array) $data as $key => $value ) { 224 if ( is_array($value) ) 225 $data[$key] = $this->decode_html_entities($value); 226 elseif ( is_string($value) ) 227 $data[$key] = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); 228 } 229 return $data; 230 } 231 219 232 function reset() { 220 233 $this->do_concat = false;
Note: See TracChangeset
for help on using the changeset viewer.