Make WordPress Core


Ignore:
Timestamp:
05/01/2012 10:09:55 PM (14 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.

File:
1 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');
Note: See TracChangeset for help on using the changeset viewer.