Make WordPress Core

Changeset 20675


Ignore:
Timestamp:
05/01/2012 10:09:55 PM (13 years ago)
Author:
nacin
Message:

Replace commas with periods when converting ratings float values to strings, to avoid issues with localized decimal points.

In these cases, we want a period because it is going to be used by CSS.

props SergeyBiryukov.
fixes #19593.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-plugin-install-list-table.php

    r20639 r20675  
    218218            <td class="vers column-rating"<?php echo $style['rating']; ?>>
    219219                <div class="star-holder" title="<?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings'] ), number_format_i18n( $plugin['num_ratings'] ) ) ?>">
    220                     <div class="star star-rating" style="width: <?php echo esc_attr( $plugin['rating'] ) ?>px"></div>
     220                    <div class="star star-rating" style="width: <?php echo esc_attr( str_replace( ',', '.', $plugin['rating'] ) ); ?>px"></div>
    221221                    <?php
    222222                        $color = get_user_option('admin_color');
  • trunk/wp-admin/includes/plugin-install.php

    r20639 r20675  
    343343        <h2><?php _e('Average Rating') ?></h2>
    344344        <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
    345             <div class="star star-rating" style="width: <?php echo esc_attr($api->rating) ?>px"></div>
     345            <div class="star star-rating" style="width: <?php echo esc_attr( str_replace( ',', '.', $api->rating ) ); ?>px"></div>
    346346            <div class="star star5"><img src="<?php echo admin_url('images/star.png?v=20110615'); ?>" alt="<?php esc_attr_e('5 stars') ?>" /></div>
    347347            <div class="star star4"><img src="<?php echo admin_url('images/star.png?v=20110615'); ?>" alt="<?php esc_attr_e('4 stars') ?>" /></div>
  • trunk/wp-includes/category-template.php

    r20656 r20675  
    673673        $tag_name = $tags[ $key ]->name;
    674674        $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( call_user_func( $topic_count_text_callback, $real_count ) ) . "' style='font-size: " .
    675             ( $smallest + ( ( $count - $min_count ) * $font_step ) )
     675            str_replace( ',', '.', ( $smallest + ( ( $count - $min_count ) * $font_step ) ) )
    676676            . "$unit;'>$tag_name</a>";
    677677    }
Note: See TracChangeset for help on using the changeset viewer.