Changeset 4660
- Timestamp:
- 12/22/2006 05:26:43 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r4658 r4660 1077 1077 // Escape single quotes, specialchar double quotes, and fix line endings. 1078 1078 function js_escape($text) { 1079 $text = wp_specialchars($text, 'double'); 1080 $text = str_replace(''', "'", $text); 1081 return preg_replace("/\r?\n/", "\\n", addslashes($text)); 1079 $safe_text = wp_specialchars($text, 'double'); 1080 $safe_text = str_replace(''', "'", $safe_text); 1081 $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text)); 1082 return apply_filters('js_escape', $safe_text, $text); 1082 1083 } 1083 1084 1084 1085 // Escaping for HTML attributes 1085 1086 function attribute_escape($text) { 1086 return wp_specialchars($text, true); 1087 $safe_text = wp_specialchars($text, true); 1088 return apply_filters('attribute_escape', $safe_text, $text); 1087 1089 } 1088 1090
Note: See TracChangeset
for help on using the changeset viewer.