diff --git a/libraries/classes/Controllers/Table/StructureController.php b/libraries/classes/Controllers/Table/StructureController.php index 77a7bda63c..1723a401ba 100644 --- a/libraries/classes/Controllers/Table/StructureController.php +++ b/libraries/classes/Controllers/Table/StructureController.php @@ -34,6 +34,7 @@ use function __; use function in_array; use function is_string; use function str_contains; +use function strtotime; /** * Displays table structure infos like columns, indexes, size, rows @@ -361,6 +362,18 @@ class StructureController extends AbstractController ]; } + if (isset($GLOBALS['showtable']['Create_time'])) { + $GLOBALS['showtable']['Create_time'] = Util::localisedDate(strtotime($GLOBALS['showtable']['Create_time'])); + } + + if (isset($GLOBALS['showtable']['Update_time'])) { + $GLOBALS['showtable']['Update_time'] = Util::localisedDate(strtotime($GLOBALS['showtable']['Update_time'])); + } + + if (isset($GLOBALS['showtable']['Check_time'])) { + $GLOBALS['showtable']['Check_time'] = Util::localisedDate(strtotime($GLOBALS['showtable']['Check_time'])); + } + return $this->template->render('table/structure/display_table_stats', [ 'db' => $GLOBALS['db'], 'table' => $GLOBALS['table'], diff --git a/libraries/classes/Twig/UtilExtension.php b/libraries/classes/Twig/UtilExtension.php index 418d717283..f8bd30cd6d 100644 --- a/libraries/classes/Twig/UtilExtension.php +++ b/libraries/classes/Twig/UtilExtension.php @@ -100,10 +100,6 @@ class UtilExtension extends AbstractExtension Generator::linkToVarDocumentation(...), ['is_safe' => ['html']], ), - new TwigFunction( - 'localised_date', - Util::localisedDate(...), - ), new TwigFunction( 'show_hint', Generator::showHint(...), diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5ec14cdd37..e1d5f8a7e9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -2495,6 +2495,11 @@ parameters: count: 1 path: libraries/classes/Controllers/Table/StructureController.php + - + message: "#^Parameter \\#1 \\$timestamp of static method PhpMyAdmin\\\\Util\\:\\:localisedDate\\(\\) expects int, \\(int\\|false\\) given\\.$#" + count: 3 + path: libraries/classes/Controllers/Table/StructureController.php + - message: "#^Parameter \\#1 \\$value of static method PhpMyAdmin\\\\Util\\:\\:formatByteDown\\(\\) expects float\\|int\\|string\\|null, \\(array\\|float\\|int\\) given\\.$#" count: 2 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 77816d9795..811644a342 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -4409,6 +4409,8 @@ + + + diff --git a/templates/table/structure/display_table_stats.twig b/templates/table/structure/display_table_stats.twig index 480aa15f07..2f0a355f72 100644 --- a/templates/table/structure/display_table_stats.twig +++ b/templates/table/structure/display_table_stats.twig @@ -152,21 +152,21 @@ {% if showtable['Create_time'] is defined %} {% trans 'Creation' %} - {{ localised_date(showtable['Create_time']|date('U')) }} + {{ showtable['Create_time'] }} {% endif %} {% if showtable['Update_time'] is defined %} {% trans 'Last update' %} - {{ localised_date(showtable['Update_time']|date('U')) }} + {{ showtable['Update_time'] }} {% endif %} {% if showtable['Check_time'] is defined %} {% trans 'Last check' %} - {{ localised_date(showtable['Check_time']|date('U')) }} + {{ showtable['Check_time'] }} {% endif %}