Ticket #21749: 21749.diff
| File 21749.diff, 10.7 KB (added by , 14 years ago) |
|---|
-
wp-admin/includes/class-wp-ms-themes-list-table.php
277 277 'delete' => '' 278 278 ); 279 279 280 $theme_key = $theme->get_stylesheet(); 280 $theme_key = $stylesheet = $theme->get_stylesheet(); 281 $theme_key = urlencode( $theme_key ); 281 282 282 283 if ( ! $allowed ) { 283 284 if ( ! $theme->errors() ) 284 $actions['enable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=enable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'enable-theme_' . $ theme_key) ) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '</a>';285 $actions['enable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=enable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'enable-theme_' . $stylesheet) ) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '</a>'; 285 286 } else { 286 $actions['disable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=disable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'disable-theme_' . $ theme_key) ) . '" title="' . esc_attr__('Disable this theme') . '">' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . '</a>';287 $actions['disable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=disable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'disable-theme_' . $stylesheet) ) . '" title="' . esc_attr__('Disable this theme') . '">' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . '</a>'; 287 288 } 288 289 289 290 if ( current_user_can('edit_themes') ) 290 $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . $theme_key ) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>';291 $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . $theme_key) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>'; 291 292 292 if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $ theme_key != get_option( 'stylesheet' ) && $theme_key!= get_option( 'template' ) )293 if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) ) 293 294 $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&checked[]=' . $theme_key . '&theme_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>'; 294 295 295 $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $ theme_key, $theme, $context );296 $actions = apply_filters( "theme_action_links_$ theme_key", $actions, $theme_key, $theme, $context );296 $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $stylesheet, $theme, $context ); 297 $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $stylesheet, $theme, $context ); 297 298 298 299 $class = ! $allowed ? 'inactive' : 'active'; 299 300 $checkbox_id = "checkbox_" . md5( $theme->get('Name') ); 300 $checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr( $ theme_key) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme->display('Name') . "</label>";301 $checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme->display('Name') . "</label>"; 301 302 302 303 $id = sanitize_html_class( $theme->get_stylesheet() ); 303 304 … … 341 342 if ( $theme->get('ThemeURI') ) 342 343 $theme_meta[] = '<a href="' . $theme->display('ThemeURI') . '" title="' . esc_attr__( 'Visit theme homepage' ) . '">' . __( 'Visit Theme Site' ) . '</a>'; 343 344 344 $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $ theme_key, $theme, $status );345 $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status ); 345 346 echo implode( ' | ', $theme_meta ); 346 347 347 348 echo "</div></td>"; … … 349 350 350 351 default: 351 352 echo "<td class='$column_name column-$column_name'$style>"; 352 do_action( 'manage_themes_custom_column', $column_name, $ theme_key, $theme );353 do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme ); 353 354 echo "</td>"; 354 355 } 355 356 } … … 357 358 echo "</tr>"; 358 359 359 360 if ( $this->is_site_themes ) 360 remove_action( "after_theme_row_$ theme_key", 'wp_theme_update_row' );361 do_action( 'after_theme_row', $ theme_key, $theme, $status );362 do_action( "after_theme_row_$ theme_key", $theme_key, $theme, $status );361 remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' ); 362 do_action( 'after_theme_row', $stylesheet, $theme, $status ); 363 do_action( "after_theme_row_$stylesheet", $stylesheet, $theme, $status ); 363 364 } 364 365 } -
wp-admin/includes/class-wp-upgrader.php
1500 1500 1501 1501 $preview_link = add_query_arg( array( 1502 1502 'preview' => 1, 1503 'template' => $template,1504 'stylesheet' => $stylesheet,1505 ), trailingslashit( get_home_url() ) );1503 'template' => urlencode( $template ), 1504 'stylesheet' => urlencode( $stylesheet ), 1505 ), trailingslashit( home_url() ) ); 1506 1506 1507 1507 $activate_link = add_query_arg( array( 1508 1508 'action' => 'activate', 1509 'template' => $template,1510 'stylesheet' => $stylesheet,1509 'template' => urlencode( $template ), 1510 'stylesheet' => urlencode( $stylesheet ), 1511 1511 ), admin_url('themes.php') ); 1512 1512 $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet ); 1513 1513 … … 1517 1517 $install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>'; 1518 1518 1519 1519 if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) 1520 $install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&theme=' . $stylesheet, 'enable-theme_' . $stylesheet ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>';1520 $install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>'; 1521 1521 1522 1522 if ( $this->type == 'web' ) 1523 1523 $install_actions['themes_page'] = '<a href="' . self_admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>'; … … 1564 1564 1565 1565 $preview_link = add_query_arg( array( 1566 1566 'preview' => 1, 1567 'template' => $template,1568 'stylesheet' => $stylesheet,1569 ), trailingslashit( get_home_url() ) );1567 'template' => urlencode( $template ), 1568 'stylesheet' => urlencode( $stylesheet ), 1569 ), trailingslashit( home_url() ) ); 1570 1570 1571 1571 $activate_link = add_query_arg( array( 1572 1572 'action' => 'activate', 1573 'template' => $template,1574 'stylesheet' => $stylesheet,1573 'template' => urlencode( $template ), 1574 'stylesheet' => urlencode( $stylesheet ), 1575 1575 ), admin_url('themes.php') ); 1576 1576 $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet ); 1577 1577 -
wp-admin/includes/theme.php
23 23 24 24 ob_start(); 25 25 if ( empty( $redirect ) ) 26 $redirect = wp_nonce_url('themes.php?action=delete&stylesheet=' . $stylesheet, 'delete-theme_' . $stylesheet);26 $redirect = wp_nonce_url('themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet); 27 27 if ( false === ($credentials = request_filesystem_credentials($redirect)) ) { 28 28 $data = ob_get_contents(); 29 29 ob_end_clean(); -
wp-admin/includes/class-wp-themes-list-table.php
128 128 $activate_link = wp_nonce_url( "themes.php?action=activate&template=" . urlencode( $template ) . "&stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet ); 129 129 130 130 $preview_link = esc_url( add_query_arg( 131 array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ),131 array( 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), 'preview_iframe' => true, 'TB_iframe' => 'true' ), 132 132 home_url( '/' ) ) ); 133 133 134 134 $actions = array(); … … 143 143 . __( 'Live Preview' ) . '</a>'; 144 144 145 145 if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) 146 $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&stylesheet=$stylesheet", 'delete-theme_' . $stylesheet )146 $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ) 147 147 . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) ) 148 148 . "' );" . '">' . __( 'Delete' ) . '</a>'; 149 149 -
wp-admin/theme-editor.php
46 46 wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) ); 47 47 48 48 if ( $theme ) 49 $stylesheet = urldecode( $theme );49 $stylesheet = $theme; 50 50 else 51 51 $stylesheet = get_stylesheet(); 52 52 … … 68 68 $relative_file = 'style.css'; 69 69 $file = $allowed_files['style.css']; 70 70 } else { 71 $relative_file = urldecode( stripslashes( $file ));71 $relative_file = stripslashes( $file ); 72 72 $file = $theme->get_stylesheet_directory() . '/' . $relative_file; 73 73 } 74 74
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)