Opened 13 years ago
Closed 13 years ago
#18460 closed defect (bug) (fixed)
admin css class 'branch-3-2' and locale 'fr_FR'
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | minor | Version: | 3.2 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description
In the backend of WordPress 3.2, there is an issue linked to the use of locale 'fr_FR' when generating the CSS class which define WordPress version.
In french notation, the numeric separator is comma. so on line 90 of file wp-admin/admin-header.php isn't adapted :
$admin_body_class .= ' branch-' . str_replace( '.', '-', floatval( $wp_version ) );
a possible solution :
$admin_body_class .= ' branch-' . str_replace( array('.', ','), '-', floatval( $wp_version ) );
Attachments (1)
Change History (4)
#2
@
13 years ago
For anyone not aware of why; PHP when running in a locale-specific environment (such as french) will cause some PHP functions to return localised values, in the case of floatval(), it'll return '3,2' rather than 3.2 as PHP uses the locale-specific decimal/thousands markers. (float)'3.14' will also be 3,14, same as printf, same as every other function you can think of. echo intval(10234)
can also output as '10,234' in certain locales.
An example of this in action: (Works on most Linux installs)
setlocale(LC_ALL, 'fr_FR'); var_dump( floatval( '3.2') ); //3,2 echo (float)'2' * (float)'1.1'; //2.2 - calculations work as expected as PHP handles it internally, it's purely output which is affected
Related: #17496
floatval( $wp_version )
indeed returns3,3
with French PHP locale.Attaching a patch.