Make WordPress Core


Ignore:
Timestamp:
04/18/2010 03:38:47 AM (16 years ago)
Author:
dd32
Message:

Escape/texturize Admin menu titles. Fixes page titles such as "Foo & Bar" not being entity encoded. Also includes some basic whitespace/standards cleanup to a related function. Fixes #12039

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r14126 r14127  
    819819    $hookname = get_plugin_page_hookname( $menu_slug, '' );
    820820
    821     if (!empty ( $function ) && !empty ( $hookname ) && current_user_can( $capability ) )
     821    if ( !empty( $function ) && !empty( $hookname ) && current_user_can( $capability ) )
    822822        add_action( $hookname, $function );
    823823
    824     if ( empty($icon_url) ) {
     824    if ( empty($icon_url) )
    825825        $icon_url = esc_url( admin_url( 'images/generic.png' ) );
    826     } elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) {
     826    elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
    827827        $icon_url = 'https://' . substr($icon_url, 7);
    828     }
    829 
    830     $new_menu = array ( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    831 
    832     if ( NULL === $position  ) {
     828
     829    $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
     830
     831    if ( null === $position  )
    833832        $menu[] = $new_menu;
    834     } else {
     833    else
    835834        $menu[$position] = $new_menu;
    836     }
    837835
    838836    $_registered_pages[$hookname] = true;
Note: See TracChangeset for help on using the changeset viewer.