diff --git a/ChangeLog b/ChangeLog index 5d47831e7..4e8848ea0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -75,6 +75,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA $cfg['MaxCharactersInDisplayedSQL'] - bug #1746186 LeftLogoLink fails if set to some external site . [transformations]: remove "auto-detect" MIME-type that was never implemented ++ [display] patch #1749705, Allow multibyte characters in number formatting, + thanks to garas 2.10.3.0 (not yet released) diff --git a/db_printview.php b/db_printview.php index 77b06e636..ed9baac80 100644 --- a/db_printview.php +++ b/db_printview.php @@ -135,9 +135,9 @@ else { ' . number_format($sts_data['TABLE_ROWS'], 0, $number_decimal_separator, $number_thousands_separator) . '' . "\n"; + echo '' . PMA_formatNumber($sts_data['TABLE_ROWS'], 0) . '' . "\n"; } else { - echo number_format($sts_data['TABLE_ROWS'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; + echo PMA_formatNumber($sts_data['TABLE_ROWS'], 0) . "\n"; } ?> @@ -218,10 +218,10 @@ else { ?> - + - + -- diff --git a/lang/czech-iso-8859-2.inc.php b/lang/czech-iso-8859-2.inc.php index d49d0de1d..c359cf93a 100644 --- a/lang/czech-iso-8859-2.inc.php +++ b/lang/czech-iso-8859-2.inc.php @@ -8,7 +8,7 @@ $charset = 'iso-8859-2'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); diff --git a/lang/czech-utf-8.inc.php b/lang/czech-utf-8.inc.php index 998808e5b..dd349ccf6 100644 --- a/lang/czech-utf-8.inc.php +++ b/lang/czech-utf-8.inc.php @@ -9,7 +9,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); diff --git a/lang/czech-windows-1250.inc.php b/lang/czech-windows-1250.inc.php index b370f58fa..9c954f5d1 100644 --- a/lang/czech-windows-1250.inc.php +++ b/lang/czech-windows-1250.inc.php @@ -8,7 +8,7 @@ $charset = 'windows-1250'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); diff --git a/lang/finnish-iso-8859-1.inc.php b/lang/finnish-iso-8859-1.inc.php index 6a57102ca..e2aa4e77e 100644 --- a/lang/finnish-iso-8859-1.inc.php +++ b/lang/finnish-iso-8859-1.inc.php @@ -8,7 +8,7 @@ $charset = 'iso-8859-1'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('tavua', 'kt', 'Mt', 'Gt', 'Tt', 'Pt', 'Et'); diff --git a/lang/finnish-iso-8859-15.inc.php b/lang/finnish-iso-8859-15.inc.php index d7787f624..9afd9737b 100644 --- a/lang/finnish-iso-8859-15.inc.php +++ b/lang/finnish-iso-8859-15.inc.php @@ -8,7 +8,7 @@ $charset = 'iso-8859-15'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('tavua', 'kt', 'Mt', 'Gt', 'Tt', 'Pt', 'Et'); diff --git a/lang/finnish-utf-8.inc.php b/lang/finnish-utf-8.inc.php index e18ebd94a..8dee6d3c7 100644 --- a/lang/finnish-utf-8.inc.php +++ b/lang/finnish-utf-8.inc.php @@ -9,7 +9,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('tavua', 'kt', 'Mt', 'Gt', 'Tt', 'Pt', 'Et'); diff --git a/lang/french-iso-8859-1.inc.php b/lang/french-iso-8859-1.inc.php index 570a98d34..8f3e518cc 100644 --- a/lang/french-iso-8859-1.inc.php +++ b/lang/french-iso-8859-1.inc.php @@ -3,7 +3,7 @@ $charset = 'iso-8859-1'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('o', 'Kio', 'Mio', 'Gio', 'Tio', 'Pio', 'Eio'); diff --git a/lang/french-iso-8859-15.inc.php b/lang/french-iso-8859-15.inc.php index a38fc4f11..f51893e48 100644 --- a/lang/french-iso-8859-15.inc.php +++ b/lang/french-iso-8859-15.inc.php @@ -3,7 +3,7 @@ $charset = 'iso-8859-15'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('o', 'Kio', 'Mio', 'Gio', 'Tio', 'Pio', 'Eio'); diff --git a/lang/french-utf-8.inc.php b/lang/french-utf-8.inc.php index 0b39a8056..2821a8548 100644 --- a/lang/french-utf-8.inc.php +++ b/lang/french-utf-8.inc.php @@ -4,7 +4,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('o', 'Kio', 'Mio', 'Gio', 'Tio', 'Pio', 'Eio'); diff --git a/lang/georgian-utf-8.inc.php b/lang/georgian-utf-8.inc.php index c5556efaa..17f679264 100644 --- a/lang/georgian-utf-8.inc.php +++ b/lang/georgian-utf-8.inc.php @@ -12,7 +12,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; // ('ltr' for left to right, 'rtl' for right to left) -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('ბაიტი', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/hungarian-iso-8859-2.inc.php b/lang/hungarian-iso-8859-2.inc.php index 7393fb992..02926f97b 100644 --- a/lang/hungarian-iso-8859-2.inc.php +++ b/lang/hungarian-iso-8859-2.inc.php @@ -5,7 +5,7 @@ $charset = 'iso-8859-2'; $text_dir = 'ltr'; // ('ltr': balról jobbra, 'rtl': jobbról balra) -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // Byte, Kilo, Mega, Giga, Tera, Peta, Exa rövidítései $byteUnits = array('Bájt', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/hungarian-utf-8.inc.php b/lang/hungarian-utf-8.inc.php index 52ba09d36..7352e958a 100644 --- a/lang/hungarian-utf-8.inc.php +++ b/lang/hungarian-utf-8.inc.php @@ -6,7 +6,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; // ('ltr': balrĂłl jobbra, 'rtl': jobbrĂłl balra) -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // Byte, Kilo, Mega, Giga, Tera, Peta, Exa rĂśvidĂ­tĂŠsei $byteUnits = array('BĂĄjt', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/latvian-utf-8.inc.php b/lang/latvian-utf-8.inc.php index b6daefefd..11105d7ae 100644 --- a/lang/latvian-utf-8.inc.php +++ b/lang/latvian-utf-8.inc.php @@ -8,7 +8,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; // ('ltr' for left to right, 'rtl' for right to left) -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('baiti', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/latvian-windows-1257.inc.php b/lang/latvian-windows-1257.inc.php index 7a258c4d1..bebff17f5 100644 --- a/lang/latvian-windows-1257.inc.php +++ b/lang/latvian-windows-1257.inc.php @@ -7,7 +7,7 @@ $charset = 'windows-1257'; $text_dir = 'ltr'; // ('ltr' for left to right, 'rtl' for right to left) -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = '.'; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('baiti', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/lithuanian-utf-8.inc.php b/lang/lithuanian-utf-8.inc.php index d8c7f3c46..18fbdde3f 100644 --- a/lang/lithuanian-utf-8.inc.php +++ b/lang/lithuanian-utf-8.inc.php @@ -4,8 +4,8 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; // ('ltr' for left to right, 'rtl' for right to left) -$number_thousands_separator = ','; -$number_decimal_separator = '.'; +$number_thousands_separator = ' '; +$number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/lithuanian-windows-1257.inc.php b/lang/lithuanian-windows-1257.inc.php index a7c17d679..a1c244cd0 100644 --- a/lang/lithuanian-windows-1257.inc.php +++ b/lang/lithuanian-windows-1257.inc.php @@ -3,8 +3,8 @@ $charset = 'windows-1257'; $text_dir = 'ltr'; // ('ltr' for left to right, 'rtl' for right to left) -$number_thousands_separator = ','; -$number_decimal_separator = '.'; +$number_thousands_separator = ' '; +$number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/polish-iso-8859-2.inc.php b/lang/polish-iso-8859-2.inc.php index 3edf5da06..681186395 100644 --- a/lang/polish-iso-8859-2.inc.php +++ b/lang/polish-iso-8859-2.inc.php @@ -3,7 +3,7 @@ $charset = 'iso-8859-2'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('bajtów', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/polish-utf-8.inc.php b/lang/polish-utf-8.inc.php index 6d5564501..726dd2583 100644 --- a/lang/polish-utf-8.inc.php +++ b/lang/polish-utf-8.inc.php @@ -4,7 +4,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('bajtĂłw', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/polish-windows-1250.inc.php b/lang/polish-windows-1250.inc.php index 0e5b738da..341e8ba61 100644 --- a/lang/polish-windows-1250.inc.php +++ b/lang/polish-windows-1250.inc.php @@ -3,7 +3,7 @@ $charset = 'windows-1250'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('bajtów', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/slovak-iso-8859-2.inc.php b/lang/slovak-iso-8859-2.inc.php index 68ca1797b..e98c9ae30 100644 --- a/lang/slovak-iso-8859-2.inc.php +++ b/lang/slovak-iso-8859-2.inc.php @@ -7,7 +7,7 @@ $charset = 'iso-8859-2'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('Bajtov', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/slovak-utf-8.inc.php b/lang/slovak-utf-8.inc.php index 7892f5a4f..dea84acab 100644 --- a/lang/slovak-utf-8.inc.php +++ b/lang/slovak-utf-8.inc.php @@ -8,7 +8,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('Bajtov', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/slovak-windows-1250.inc.php b/lang/slovak-windows-1250.inc.php index 1e15705a8..10e0ad2ed 100644 --- a/lang/slovak-windows-1250.inc.php +++ b/lang/slovak-windows-1250.inc.php @@ -7,7 +7,7 @@ $charset = 'windows-1250'; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('Bajtov', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); diff --git a/lang/swedish-iso-8859-1.inc.php b/lang/swedish-iso-8859-1.inc.php index 1b30fff75..b42ecbe48 100644 --- a/lang/swedish-iso-8859-1.inc.php +++ b/lang/swedish-iso-8859-1.inc.php @@ -8,7 +8,7 @@ $charset = 'iso-8859-1'; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); diff --git a/lang/swedish-utf-8.inc.php b/lang/swedish-utf-8.inc.php index 4d28d8dac..59791198a 100644 --- a/lang/swedish-utf-8.inc.php +++ b/lang/swedish-utf-8.inc.php @@ -9,7 +9,7 @@ $charset = 'utf-8'; $allow_recoding = TRUE; $allow_recoding = TRUE; $text_dir = 'ltr'; -$number_thousands_separator = ' '; +$number_thousands_separator = ' '; $number_decimal_separator = ','; // shortcuts for Byte, Kilo, Mega, Giga, Tera, Peta, Exa $byteUnits = array('bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 6d8d463e5..79fdeaed6 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1340,9 +1340,9 @@ function PMA_formatByteDown($value, $limes = 6, $comma = 0) } // end for if ($unit != $GLOBALS['byteUnits'][0]) { - $return_value = number_format($value, $comma, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator']); + $return_value = PMA_formatNumber($value, 5, $comma); } else { - $return_value = number_format($value, 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator']); + $return_value = PMA_formatNumber($value, 0); } return array($return_value, $unit); @@ -1378,11 +1378,11 @@ function PMA_formatByteDown($value, $limes = 6, $comma = 0) */ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false) { + //number_format is not multibyte safe, str_replace is safe if ($length === 0) { - return number_format($value, - $comma, - $GLOBALS['number_decimal_separator'], - $GLOBALS['number_thousands_separator']); + return str_replace(array(',', '.'), + array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']), + number_format($value, $comma)); } // this units needs no translation, ISO @@ -1441,10 +1441,10 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false) } // end for } // end if ($value >= 1) elseif (!$only_down && (float) $value !== 0.0) - $value = number_format($value, - $comma, - $GLOBALS['number_decimal_separator'], - $GLOBALS['number_thousands_separator']); + //number_format is not multibyte safe, str_replace is safe + $value = str_replace(array(',', '.'), + array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']), + number_format($value, $comma)); return $sign . $value . ' ' . $unit; } // end of the 'PMA_formatNumber' function diff --git a/libraries/engines/innodb.lib.php b/libraries/engines/innodb.lib.php index 88cb10f68..d1b6bc89f 100644 --- a/libraries/engines/innodb.lib.php +++ b/libraries/engines/innodb.lib.php @@ -154,8 +154,6 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine * @uses PMA_DBI_fetch_result() * @uses PMA_formatNumber() * @uses PMA_formatByteDown() - * @uses $GLOBALS['number_decimal_separator'] - * @uses $GLOBALS['number_thousands_separator'] * @uses $GLOBALS['strBufferPoolUsage'] * @uses $GLOBALS['strTotalUC'] * @uses $GLOBALS['strInnoDBPages'] @@ -174,7 +172,7 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine * @uses $GLOBALS['strBufferWriteWaitsInPercent'] * @uses join() * @uses htmlspecialchars() - * @uses number_format() + * @uses PMA_formatNumber() * @return string html table with stats */ function getPageBufferpool() @@ -281,7 +279,7 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine . ' ' . ($status['Innodb_buffer_pool_read_requests'] == 0 ? '---' - : htmlspecialchars(number_format($status['Innodb_buffer_pool_reads'] * 100 / $status['Innodb_buffer_pool_read_requests'], 2, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])) . ' %') . "\n" + : htmlspecialchars(PMA_formatNumber($status['Innodb_buffer_pool_reads'] * 100 / $status['Innodb_buffer_pool_read_requests'], 3, 2)) . ' %') . "\n" . '' . "\n" . ' ' . "\n" . ' ' . "\n" @@ -289,7 +287,7 @@ class PMA_StorageEngine_innodb extends PMA_StorageEngine . ' ' . ($status['Innodb_buffer_pool_write_requests'] == 0 ? '---' - : htmlspecialchars(number_format($status['Innodb_buffer_pool_wait_free'] * 100 / $status['Innodb_buffer_pool_write_requests'], 2, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])) . ' %') . "\n" + : htmlspecialchars(PMA_formatNumber($status['Innodb_buffer_pool_wait_free'] * 100 / $status['Innodb_buffer_pool_write_requests'], 3, 2)) . ' %') . "\n" . '' . "\n" . ' ' . "\n" . ' ' . "\n" diff --git a/tbl_printview.php b/tbl_printview.php index 0ffeb31c7..829d4d73d 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -450,7 +450,7 @@ foreach ($the_tables as $key => $table) { - + $table) {  ø - + $table) {  Autoindex - +