diff --git a/ChangeLog b/ChangeLog
index 76ff51a248..342af9a6db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@ phpMyAdmin - ChangeLog
- issue #18325 Allow hex representations for integers in the search box validation
- issue #14411 Fixed double tap to edit on mobile devices
- issue Update documentation to reflect that Node >= 12 is required to compile the JS and CSS files
+- issue #18578 Fixed PDF export NULL values gives a type error
5.2.1 (2023-02-07)
- issue #17522 Fix case where the routes cache file is invalid
diff --git a/doc/setup.rst b/doc/setup.rst
index 182dc101a9..5d9daf2b19 100644
--- a/doc/setup.rst
+++ b/doc/setup.rst
@@ -222,6 +222,16 @@ You can configure several phpMyAdmin features using environment variables:
.. note:: Used only if :envvar:`PMA_PORT` is empty.
+.. envvar:: PMA_SOCKET
+
+ Socket file for the database connection.
+
+.. envvar:: PMA_SOCKETS
+
+ Comma-separated list of socket files for the database connections.
+
+ .. note:: Used only if :envvar:`PMA_SOCKET` is empty.
+
.. envvar:: PMA_ABSOLUTE_URI
The fully-qualified path (``https://pma.example.net/``) where the reverse
@@ -446,7 +456,7 @@ arbitrary server - allowing you to specify MySQL/MariaDB server on the login pag
.. code-block:: sh
- docker-compose up -d
+ docker compose up -d
Customizing configuration file using docker-compose
---------------------------------------------------
@@ -563,7 +573,7 @@ Quick Install
#. Choose an appropriate distribution kit from the phpmyadmin.net
Downloads page. Some kits contain only the English messages, others
contain all languages. We'll assume you chose a kit whose name
- looks like ``phpMyAdmin-x.x.x -all-languages.tar.gz``.
+ looks like ``phpMyAdmin-x.x.x-all-languages.tar.gz``.
#. Ensure you have downloaded a genuine archive, see :ref:`verify`.
#. Untar or unzip the distribution (be sure to unzip the subdirectories):
``tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz`` in your
diff --git a/libraries/classes/Plugins/Export/Helpers/Pdf.php b/libraries/classes/Plugins/Export/Helpers/Pdf.php
index 1d70a91296..95be0adadb 100644
--- a/libraries/classes/Plugins/Export/Helpers/Pdf.php
+++ b/libraries/classes/Plugins/Export/Helpers/Pdf.php
@@ -179,7 +179,7 @@ class Pdf extends PdfLib
$l = $this->lMargin;
foreach ($this->colTitles as $col => $txt) {
$this->setXY($l, $this->tMargin);
- $this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt);
+ $this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt ?? 'NULL');
$l += $this->tablewidths[$col];
$GLOBALS['maxY'] = $GLOBALS['maxY'] < $this->GetY() ? $this->GetY() : $GLOBALS['maxY'];
}
@@ -191,7 +191,7 @@ class Pdf extends PdfLib
$this->setXY($l, $this->tMargin);
$this->Cell($this->tablewidths[$col], $GLOBALS['maxY'] - $this->tMargin, '', 1, 0, 'L', true);
$this->setXY($l, $this->tMargin);
- $this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt, 0, 'C');
+ $this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt ?? 'NULL', 0, 'C');
$l += $this->tablewidths[$col];
}
@@ -238,7 +238,7 @@ class Pdf extends PdfLib
$this->page = $currpage;
$this->setXY($l, $h);
if ($this->tablewidths[$col] > 0) {
- $this->MultiCell($this->tablewidths[$col], $lineheight, $txt, 0, $this->colAlign[$col]);
+ $this->MultiCell($this->tablewidths[$col], $lineheight, $txt ?? 'NULL', 0, $this->colAlign[$col]);
$l += $this->tablewidths[$col];
}
@@ -375,7 +375,7 @@ class Pdf extends PdfLib
$this->tablewidths[$col],
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$this->FontSizePt,
- $txt,
+ $txt ?? 'NULL',
0,
$this->colAlign[$col],
);
@@ -605,7 +605,7 @@ class Pdf extends PdfLib
$this->tablewidths[$col],
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$this->FontSizePt,
- $txt,
+ $txt ?? 'NULL',
0,
$this->colAlign[$col],
);
@@ -754,7 +754,7 @@ class Pdf extends PdfLib
while ($row = $this->results->fetchRow()) {
foreach ($colFits as $key => $val) {
/** @var float $stringWidth */
- $stringWidth = $this->GetStringWidth($row[$key]);
+ $stringWidth = $this->GetStringWidth($row[$key] ?? 'NULL');
$stringWidth += 6;
if ($adjustingMode && ($stringWidth > $sColWidth)) {
// any column whose data's width is bigger than
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 7d212e3353..c526de2b59 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -20270,11 +20270,6 @@ parameters:
count: 3
path: libraries/classes/Plugins/Export/Helpers/Pdf.php
- -
- message: "#^Parameter \\#3 \\$txt of method TCPDF\\:\\:MultiCell\\(\\) expects string, string\\|null given\\.$#"
- count: 1
- path: libraries/classes/Plugins/Export/Helpers/Pdf.php
-
-
message: "#^Parameter \\#3 \\$x2 of method TCPDF\\:\\:Line\\(\\) expects float, \\(array\\|float\\|int\\) given\\.$#"
count: 3
@@ -20310,6 +20305,11 @@ parameters:
count: 6
path: libraries/classes/Plugins/Export/Helpers/Pdf.php
+ -
+ message: "#^Variable \\$txt on left side of \\?\\? always exists and is not nullable\\.$#"
+ count: 1
+ path: libraries/classes/Plugins/Export/Helpers/Pdf.php
+
-
message: "#^Cannot cast mixed to string\\.$#"
count: 6
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index f0ea057c99..a920698051 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -6,7 +6,6 @@
cacheDirectory="build/.phpunit.cache"
executionOrder="random"
defaultTestSuite="unit"
- failOnIncomplete="true"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerWarnings="true"
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 2d54066736..ca9fdea882 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -8875,10 +8875,10 @@
tablewidths[$col]]]>
tablewidths[$col]]]>
titleFontSize ?: $this->FontSizePt]]>
- $txt
- $txt
- $txt
- $txt
+
+
+
+
$y
@@ -9050,10 +9050,6 @@
$topMargin
-
- $row[$key]
- $txt
-
diff --git a/templates/sql/enum_column_dropdown.twig b/templates/sql/enum_column_dropdown.twig
index b91dfa8cff..b4d222c0f3 100644
--- a/templates/sql/enum_column_dropdown.twig
+++ b/templates/sql/enum_column_dropdown.twig
@@ -1,5 +1,4 @@