Changeset 11245
- Timestamp:
- 05/09/2009 07:27:22 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r11204 r11245 83 83 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>'; 84 84 if ( current_user_can('delete_post', $post->ID) ) 85 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";85 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 86 86 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 87 87 $action_count = count($actions); -
trunk/wp-admin/edit-form-advanced.php
r11224 r11245 230 230 <?php 231 231 if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?> 232 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>232 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> 233 233 <?php } ?> 234 234 </div> -
trunk/wp-admin/edit-form-comment.php
r11204 r11245 70 70 <div id="major-publishing-actions"> 71 71 <div id="delete-action"> 72 <?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ){return true;}return false;\">" . __('Delete') . "</a>\n"; ?>72 <?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . esc_js(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ){return true;}return false;\">" . __('Delete') . "</a>\n"; ?> 73 73 </div> 74 74 <div id="publishing-action"> -
trunk/wp-admin/edit-link-form.php
r11224 r11245 86 86 <?php 87 87 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> 88 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>88 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> 89 89 <?php } ?> 90 90 </div> -
trunk/wp-admin/edit-page-form.php
r11204 r11245 217 217 <?php 218 218 if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?> 219 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>219 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> 220 220 <?php } ?> 221 221 </div> -
trunk/wp-admin/import/blogger.php
r11204 r11245 191 191 } 192 192 //echo '<pre>'.print_r($this,1).'</pre>'; 193 $start = js_escape( __('Import') );194 $continue = js_escape( __('Continue') );195 $stop = js_escape( __('Importing...') );196 $authors = js_escape( __('Set Authors') );197 $loadauth = js_escape( __('Preparing author mapping form...') );198 $authhead = js_escape( __('Final Step: Author Mapping') );199 $nothing = js_escape( __('Nothing was imported. Had you already imported this blog?') );193 $start = esc_js( __('Import') ); 194 $continue = esc_js( __('Continue') ); 195 $stop = esc_js( __('Importing...') ); 196 $authors = esc_js( __('Set Authors') ); 197 $loadauth = esc_js( __('Preparing author mapping form...') ); 198 $authhead = esc_js( __('Final Step: Author Mapping') ); 199 $nothing = esc_js( __('Nothing was imported. Had you already imported this blog?') ); 200 200 $title = __('Blogger Blogs'); 201 201 $name = __('Blog Name'); … … 216 216 $value = $authors; 217 217 $value = esc_attr($value); 218 $blogtitle = js_escape( $blog['title'] );218 $blogtitle = esc_js( $blog['title'] ); 219 219 $pdone = isset($blog['posts_done']) ? (int) $blog['posts_done'] : 0; 220 220 $cdone = isset($blog['comments_done']) ? (int) $blog['comments_done'] : 0; … … 659 659 $mapthis = __('Blogger username'); 660 660 $tothis = __('WordPress login'); 661 $submit = js_escape( __('Save Changes') );661 $submit = esc_js( __('Save Changes') ); 662 662 663 663 foreach ( $blog['authors'] as $i => $author ) -
trunk/wp-admin/includes/template.php
r11242 r11245 1447 1447 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; 1448 1448 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; 1449 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";1449 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1450 1450 } 1451 1451 if ( in_array($post->post_status, array('pending', 'draft')) ) { … … 1660 1660 $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 1661 1661 $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; 1662 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";1662 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 1663 1663 } 1664 1664 if ( in_array($post->post_status, array('pending', 'draft')) ) { -
trunk/wp-admin/link-manager.php
r11204 r11245 198 198 $actions = array(); 199 199 $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>'; 200 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf( __("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";200 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm('" . esc_js(sprintf( __("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 201 201 $action_count = count($actions); 202 202 $i = 0; -
trunk/wp-admin/press-this.php
r11224 r11245 403 403 break; 404 404 case 'photo' : 405 jQuery('#extra_fields').before('<p id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo js_escape( __( 'Loading...' ) ); ?></p>');405 jQuery('#extra_fields').before('<p id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></p>'); 406 406 jQuery.ajax({ 407 407 type: "GET", -
trunk/wp-admin/themes.php
r11204 r11245 198 198 $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $theme_name)) . '">' . __('Preview') . '</a>'; 199 199 if ( current_user_can('update_themes') ) 200 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet) . '" onclick="' . "if ( confirm('" . js_escape(sprintf( __("You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';200 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet) . '" onclick="' . "if ( confirm('" . esc_js(sprintf( __("You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>'; 201 201 $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]); 202 202 -
trunk/wp-admin/update-core.php
r11204 r11245 59 59 if ( $dismissed ) { 60 60 61 $show_text = js_escape(__('Show hidden updates'));62 $hide_text = js_escape(__('Hide hidden updates'));61 $show_text = esc_js(__('Show hidden updates')); 62 $hide_text = esc_js(__('Hide hidden updates')); 63 63 ?> 64 64 <script type="text/javascript"> -
trunk/wp-admin/upload.php
r11204 r11245 342 342 $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>'; 343 343 if ( current_user_can('delete_post', $post->ID) ) 344 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";344 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 345 345 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 346 346 if ( current_user_can('edit_post', $post->ID) ) -
trunk/wp-content/themes/default/functions.php
r11204 r11245 252 252 } 253 253 function kRevert() { 254 document.getElementById('headerimage').value = '<?php echo js_escape(kubrick_header_image()); ?>';255 document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo js_escape(kubrick_upper_color()); ?>';256 document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo js_escape(kubrick_lower_color()); ?>';257 document.getElementById('header').style.background = 'url("<?php echo js_escape(kubrick_header_image_url()); ?>") center no-repeat';254 document.getElementById('headerimage').value = '<?php echo esc_js(kubrick_header_image()); ?>'; 255 document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo esc_js(kubrick_upper_color()); ?>'; 256 document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo esc_js(kubrick_lower_color()); ?>'; 257 document.getElementById('header').style.background = 'url("<?php echo esc_js(kubrick_header_image_url()); ?>") center no-repeat'; 258 258 document.getElementById('header').style.color = ''; 259 document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo js_escape(kubrick_header_color_string()); ?>';260 document.getElementById('fontdisplay').value = '<?php echo js_escape(kubrick_header_display_string()); ?>';259 document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo esc_js(kubrick_header_color_string()); ?>'; 260 document.getElementById('fontdisplay').value = '<?php echo esc_js(kubrick_header_display_string()); ?>'; 261 261 document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; 262 262 } -
trunk/wp-includes/bookmark.php
r11204 r11245 358 358 $value = esc_attr($value); 359 359 else if ( 'js' == $context ) 360 $value = js_escape($value);360 $value = esc_js($value); 361 361 362 362 return $value; -
trunk/wp-includes/class.wp-scripts.php
r11058 r11245 61 61 continue; 62 62 } 63 $data .= "$eol\t$var: \"" . js_escape( $val ) . '"';63 $data .= "$eol\t$var: \"" . esc_js( $val ) . '"'; 64 64 $eol = ",\n"; 65 65 } -
trunk/wp-includes/formatting.php
r11215 r11245 2055 2055 * The filter 'js_escape' is also applied here. 2056 2056 * 2057 * @since 2. 0.42057 * @since 2.8.0 2058 2058 * 2059 2059 * @param string $text The text to be escaped. 2060 2060 * @return string Escaped text. 2061 2061 */ 2062 function js_escape($text) {2062 function esc_js( $text ) { 2063 2063 $safe_text = wp_check_invalid_utf8( $text ); 2064 2064 $safe_text = wp_specialchars( $safe_text, ENT_COMPAT ); … … 2066 2066 $safe_text = preg_replace( "/\r?\n/", "\\n", addslashes( $safe_text ) ); 2067 2067 return apply_filters( 'js_escape', $safe_text, $text ); 2068 } 2069 2070 /** 2071 * Escape single quotes, specialchar double quotes, and fix line endings. 2072 * 2073 * The filter 'js_escape' is also applied by esc_js() 2074 * 2075 * @since 2.0.4 2076 * 2077 * @deprecated 2.8.0 2078 * @see esc_js() 2079 * 2080 * @param string $text The text to be escaped. 2081 * @return string Escaped text. 2082 */ 2083 function js_escape( $text ) { 2084 return esc_js( $text ); 2068 2085 } 2069 2086 -
trunk/wp-includes/js/tinymce/langs/wp-langs.php
r10774 r11245 19 19 20 20 if ( 'en' == $language ) return $text; 21 else return js_escape($text);21 else return esc_js($text); 22 22 } 23 23 -
trunk/wp-includes/post.php
r11222 r11245 906 906 $value = esc_attr($value); 907 907 else if ( 'js' == $context ) 908 $value = js_escape($value);908 $value = esc_js($value); 909 909 910 910 return $value; -
trunk/wp-includes/taxonomy.php
r11216 r11245 1014 1014 $value = esc_attr($value); 1015 1015 else if ( 'js' == $context ) 1016 $value = js_escape($value);1016 $value = esc_js($value); 1017 1017 1018 1018 return $value;
Note: See TracChangeset
for help on using the changeset viewer.