WordPress.org

Make WordPress Core

Ticket #18304: 18304.2.patch

File 18304.2.patch, 2.1 KB (added by johnbillion, 7 years ago)
  • wp-admin/admin-header.php

     
    108108<div id="wphead">
    109109<?php
    110110
     111if ( is_network_admin() ) {
     112        $blog_name = esc_html($current_site->site_name);
     113        if ( function_exists('mb_strlen') )
     114                $blog_name_append_length = mb_strlen( __( 'Network Admin' ), 'UTF-8' );
     115        else
     116                $blog_name_append_length = strlen( __( 'Network Admin' ) );
     117} else if ( is_user_admin() ) {
     118        $blog_name = esc_html($current_site->site_name);
     119        if ( function_exists('mb_strlen') )
     120                $blog_name_append_length = mb_strlen( __( 'Global Dashboard' ), 'UTF-8' );
     121        else
     122                $blog_name_append_length = strlen( __( 'Global Dashboard' ) );
     123} else {
     124        $blog_name = get_bloginfo('name', 'display');
     125        $blog_name_append_length = 0;
     126}
     127
     128$blog_name_length = 40 - $blog_name_append_length;
     129$title_class = '';
     130$blog_name_excerpt = wp_html_excerpt($blog_name, $blog_name_length);
     131if ( $blog_name != $blog_name_excerpt )
     132        $blog_name_excerpt = trim($blog_name_excerpt) . '&hellip;';
     133
     134$blog_name = $blog_name_excerpt;
     135unset($blog_name_excerpt,$blog_name_length,$blog_name_append_length);
     136
    111137if ( is_network_admin() )
    112         $blog_name = sprintf( __('%s Network Admin'), esc_html($current_site->site_name) );
     138        $blog_name = sprintf( __('%s Network Admin'), $blog_name );
    113139elseif ( is_user_admin() )
    114         $blog_name = sprintf( __('%s Global Dashboard'), esc_html($current_site->site_name) );
    115 else
    116         $blog_name = get_bloginfo('name', 'display');
    117 if ( '' == $blog_name ) {
     140        $blog_name = sprintf( __('%s Global Dashboard'), $blog_name );
     141else if ( '' == $blog_name )
    118142        $blog_name = __( 'Visit Site' );
    119 } else {
    120         $blog_name_excerpt = wp_html_excerpt($blog_name, 40);
    121         if ( $blog_name != $blog_name_excerpt )
    122                 $blog_name_excerpt = trim($blog_name_excerpt) . '&hellip;';
    123         $blog_name = $blog_name_excerpt;
    124         unset($blog_name_excerpt);
    125 }
    126 $title_class = '';
     143
    127144if ( function_exists('mb_strlen') ) {
    128145        if ( mb_strlen($blog_name, 'UTF-8') > 30 )
    129146                $title_class = 'class="long-title"';