Changeset 4661
- Timestamp:
- 12/22/2006 05:27:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-includes/functions-formatting.php
r4657 r4661 1047 1047 // Escape single quotes, specialchar double quotes, and fix line endings. 1048 1048 function js_escape($text) { 1049 $text = wp_specialchars($text, 'double'); 1050 $text = str_replace(''', "'", $text); 1051 return preg_replace("/\r?\n/", "\\n", addslashes($text)); 1049 $safe_text = wp_specialchars($text, 'double'); 1050 $safe_text = str_replace(''', "'", $safe_text); 1051 $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text)); 1052 return apply_filters('js_escape', $safe_text, $text); 1052 1053 } 1053 1054 1054 1055 // Escaping for HTML attributes 1055 1056 function attribute_escape($text) { 1056 return wp_specialchars($text, true); 1057 $safe_text = wp_specialchars($text, true); 1058 return apply_filters('attribute_escape', $safe_text, $text); 1057 1059 } 1058 1060
Note: See TracChangeset
for help on using the changeset viewer.