Fix 32-bit issues
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
cd75e10a2a
commit
6699fb1923
@ -68,6 +68,7 @@ use function sys_get_temp_dir;
|
||||
use function time;
|
||||
use function trigger_error;
|
||||
use function trim;
|
||||
use function crc32;
|
||||
|
||||
/**
|
||||
* Configuration class
|
||||
@ -866,11 +867,11 @@ class Config
|
||||
{
|
||||
global $PMA_Theme;
|
||||
|
||||
return (int) (
|
||||
$this->sourceMtime +
|
||||
$this->defaultSourceMtime +
|
||||
$this->get('user_preferences_mtime') +
|
||||
($PMA_Theme->mtimeInfo ?? 0) +
|
||||
return crc32(
|
||||
$this->sourceMtime .
|
||||
$this->defaultSourceMtime .
|
||||
$this->get('user_preferences_mtime') .
|
||||
($PMA_Theme->mtimeInfo ?? 0) .
|
||||
($PMA_Theme->filesizeInfo ?? 0)
|
||||
);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ class Util
|
||||
/**
|
||||
* Returns the formatted maximum size for an upload
|
||||
*
|
||||
* @param int|string $max_upload_size the size
|
||||
* @param int|float|string $max_upload_size the size
|
||||
*
|
||||
* @return string the message
|
||||
*
|
||||
@ -696,9 +696,9 @@ class Util
|
||||
*
|
||||
* @param string|int $formatted_size the size expression (for example 8MB)
|
||||
*
|
||||
* @return int The numerical part of the expression (for example 8)
|
||||
* @return int|float The numerical part of the expression (for example 8)
|
||||
*/
|
||||
public static function extractValueFromFormattedSize($formatted_size): int
|
||||
public static function extractValueFromFormattedSize($formatted_size)
|
||||
{
|
||||
$return_value = -1;
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ use function realpath;
|
||||
use function strip_tags;
|
||||
use function stristr;
|
||||
use function sys_get_temp_dir;
|
||||
use function crc32;
|
||||
|
||||
class ConfigTest extends AbstractTestCase
|
||||
{
|
||||
@ -950,11 +951,13 @@ class ConfigTest extends AbstractTestCase
|
||||
*/
|
||||
public function testGetThemeUniqueValue(): void
|
||||
{
|
||||
$partial_sum = $this->object->sourceMtime +
|
||||
$this->object->defaultSourceMtime +
|
||||
$this->object->get('user_preferences_mtime') +
|
||||
$GLOBALS['PMA_Theme']->mtimeInfo +
|
||||
$GLOBALS['PMA_Theme']->filesizeInfo;
|
||||
$partial_sum = crc32(
|
||||
$this->object->sourceMtime .
|
||||
$this->object->defaultSourceMtime .
|
||||
$this->object->get('user_preferences_mtime') .
|
||||
$GLOBALS['PMA_Theme']->mtimeInfo .
|
||||
$GLOBALS['PMA_Theme']->filesizeInfo
|
||||
);
|
||||
|
||||
$this->assertEquals($partial_sum, $this->object->getThemeUniqueValue());
|
||||
}
|
||||
|
||||
@ -948,12 +948,12 @@ class UtilTest extends AbstractTestCase
|
||||
* Test for Util::extractValueFromFormattedSize
|
||||
*
|
||||
* @param int|string $size Size
|
||||
* @param int $expected Expected value
|
||||
* @param int|float $expected Expected value (float on some cpu architectures)
|
||||
*
|
||||
* @covers \PhpMyAdmin\Util::extractValueFromFormattedSize
|
||||
* @dataProvider providerExtractValueFromFormattedSize
|
||||
*/
|
||||
public function testExtractValueFromFormattedSize($size, int $expected): void
|
||||
public function testExtractValueFromFormattedSize($size, $expected): void
|
||||
{
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
@ -1378,14 +1378,14 @@ class UtilTest extends AbstractTestCase
|
||||
/**
|
||||
* Test for Util::getFormattedMaximumUploadSize
|
||||
*
|
||||
* @param int $size Size
|
||||
* @param string $unit Unit
|
||||
* @param string $res Result
|
||||
* @param int|float $size Size (float on some cpu architectures)
|
||||
* @param string $unit Unit
|
||||
* @param string $res Result
|
||||
*
|
||||
* @covers \PhpMyAdmin\Util::getFormattedMaximumUploadSize
|
||||
* @dataProvider providerGetFormattedMaximumUploadSize
|
||||
*/
|
||||
public function testGetFormattedMaximumUploadSize(int $size, string $unit, string $res): void
|
||||
public function testGetFormattedMaximumUploadSize($size, string $unit, string $res): void
|
||||
{
|
||||
$this->assertEquals(
|
||||
'(' . __('Max: ') . $res . $unit . ')',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user