Skip to content

Commit 57fd47a

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2 parents f570bf6 + ea971c1 commit 57fd47a

File tree

10 files changed

+448
-455
lines changed

10 files changed

+448
-455
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ phpMyAdmin - ChangeLog
6565
- issue #18325 Allow hex representations for integers in the search box validation
6666
- issue #14411 Fixed double tap to edit on mobile devices
6767
- issue Update documentation to reflect that Node >= 12 is required to compile the JS and CSS files
68+
- issue #18578 Fixed PDF export NULL values gives a type error
6869

6970
5.2.1 (2023-02-07)
7071
- issue #17522 Fix case where the routes cache file is invalid

doc/setup.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ You can configure several phpMyAdmin features using environment variables:
222222

223223
.. note:: Used only if :envvar:`PMA_PORT` is empty.
224224

225+
.. envvar:: PMA_SOCKET
226+
227+
Socket file for the database connection.
228+
229+
.. envvar:: PMA_SOCKETS
230+
231+
Comma-separated list of socket files for the database connections.
232+
233+
.. note:: Used only if :envvar:`PMA_SOCKET` is empty.
234+
225235
.. envvar:: PMA_ABSOLUTE_URI
226236

227237
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
446456

447457
.. code-block:: sh
448458
449-
docker-compose up -d
459+
docker compose up -d
450460
451461
Customizing configuration file using docker-compose
452462
---------------------------------------------------
@@ -563,7 +573,7 @@ Quick Install
563573
#. Choose an appropriate distribution kit from the phpmyadmin.net
564574
Downloads page. Some kits contain only the English messages, others
565575
contain all languages. We'll assume you chose a kit whose name
566-
looks like ``phpMyAdmin-x.x.x -all-languages.tar.gz``.
576+
looks like ``phpMyAdmin-x.x.x-all-languages.tar.gz``.
567577
#. Ensure you have downloaded a genuine archive, see :ref:`verify`.
568578
#. Untar or unzip the distribution (be sure to unzip the subdirectories):
569579
``tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz`` in your

libraries/classes/Plugins/Export/Helpers/Pdf.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function Header(): void
179179
$l = $this->lMargin;
180180
foreach ($this->colTitles as $col => $txt) {
181181
$this->setXY($l, $this->tMargin);
182-
$this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt);
182+
$this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt ?? 'NULL');
183183
$l += $this->tablewidths[$col];
184184
$GLOBALS['maxY'] = $GLOBALS['maxY'] < $this->GetY() ? $this->GetY() : $GLOBALS['maxY'];
185185
}
@@ -191,7 +191,7 @@ public function Header(): void
191191
$this->setXY($l, $this->tMargin);
192192
$this->Cell($this->tablewidths[$col], $GLOBALS['maxY'] - $this->tMargin, '', 1, 0, 'L', true);
193193
$this->setXY($l, $this->tMargin);
194-
$this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt, 0, 'C');
194+
$this->MultiCell($this->tablewidths[$col], $this->FontSizePt, $txt ?? 'NULL', 0, 'C');
195195
$l += $this->tablewidths[$col];
196196
}
197197

@@ -238,7 +238,7 @@ public function morepagestable(int|float $lineheight = 8): void
238238
$this->page = $currpage;
239239
$this->setXY($l, $h);
240240
if ($this->tablewidths[$col] > 0) {
241-
$this->MultiCell($this->tablewidths[$col], $lineheight, $txt, 0, $this->colAlign[$col]);
241+
$this->MultiCell($this->tablewidths[$col], $lineheight, $txt ?? 'NULL', 0, $this->colAlign[$col]);
242242
$l += $this->tablewidths[$col];
243243
}
244244

@@ -375,7 +375,7 @@ public function getTriggers(string $db, string $table): void
375375
$this->tablewidths[$col],
376376
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
377377
$this->FontSizePt,
378-
$txt,
378+
$txt ?? 'NULL',
379379
0,
380380
$this->colAlign[$col],
381381
);
@@ -605,7 +605,7 @@ public function getTableDef(
605605
$this->tablewidths[$col],
606606
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
607607
$this->FontSizePt,
608-
$txt,
608+
$txt ?? 'NULL',
609609
0,
610610
$this->colAlign[$col],
611611
);
@@ -754,7 +754,7 @@ public function mysqlReport(string $query): void
754754
while ($row = $this->results->fetchRow()) {
755755
foreach ($colFits as $key => $val) {
756756
/** @var float $stringWidth */
757-
$stringWidth = $this->GetStringWidth($row[$key]);
757+
$stringWidth = $this->GetStringWidth($row[$key] ?? 'NULL');
758758
$stringWidth += 6;
759759
if ($adjustingMode && ($stringWidth > $sColWidth)) {
760760
// any column whose data's width is bigger than

phpstan-baseline.neon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20270,11 +20270,6 @@ parameters:
2027020270
count: 3
2027120271
path: libraries/classes/Plugins/Export/Helpers/Pdf.php
2027220272

20273-
-
20274-
message: "#^Parameter \\#3 \\$txt of method TCPDF\\:\\:MultiCell\\(\\) expects string, string\\|null given\\.$#"
20275-
count: 1
20276-
path: libraries/classes/Plugins/Export/Helpers/Pdf.php
20277-
2027820273
-
2027920274
message: "#^Parameter \\#3 \\$x2 of method TCPDF\\:\\:Line\\(\\) expects float, \\(array\\|float\\|int\\) given\\.$#"
2028020275
count: 3
@@ -20310,6 +20305,11 @@ parameters:
2031020305
count: 6
2031120306
path: libraries/classes/Plugins/Export/Helpers/Pdf.php
2031220307

20308+
-
20309+
message: "#^Variable \\$txt on left side of \\?\\? always exists and is not nullable\\.$#"
20310+
count: 1
20311+
path: libraries/classes/Plugins/Export/Helpers/Pdf.php
20312+
2031320313
-
2031420314
message: "#^Cannot cast mixed to string\\.$#"
2031520315
count: 6

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
cacheDirectory="build/.phpunit.cache"
77
executionOrder="random"
88
defaultTestSuite="unit"
9-
failOnIncomplete="true"
109
failOnRisky="true"
1110
failOnWarning="true"
1211
displayDetailsOnTestsThatTriggerWarnings="true"

psalm-baseline.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8875,10 +8875,10 @@
88758875
<code><![CDATA[$this->tablewidths[$col]]]></code>
88768876
<code><![CDATA[$this->tablewidths[$col]]]></code>
88778877
<code><![CDATA[$this->titleFontSize ?: $this->FontSizePt]]></code>
8878-
<code>$txt</code>
8879-
<code>$txt</code>
8880-
<code>$txt</code>
8881-
<code>$txt</code>
8878+
<code><![CDATA[$txt ?? 'NULL']]></code>
8879+
<code><![CDATA[$txt ?? 'NULL']]></code>
8880+
<code><![CDATA[$txt ?? 'NULL']]></code>
8881+
<code><![CDATA[$txt ?? 'NULL']]></code>
88828882
<code>$y</code>
88838883
</MixedArgument>
88848884
<MixedArrayAccess>
@@ -9050,10 +9050,6 @@
90509050
<ParamNameMismatch>
90519051
<code>$topMargin</code>
90529052
</ParamNameMismatch>
9053-
<PossiblyNullArgument>
9054-
<code>$row[$key]</code>
9055-
<code>$txt</code>
9056-
</PossiblyNullArgument>
90579053
<PossiblyNullOperand>
90589054
<code><![CDATA[$GLOBALS['maxY']]]></code>
90599055
</PossiblyNullOperand>

templates/sql/enum_column_dropdown.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<select>
2-
<option value="">&nbsp;</option>
32
{% for value in values %}
43
<option value="{{ value|raw }}"{{ value in selected_values ? " selected" }}>{{ value|raw }}</option>
54
{% endfor %}

test/classes/Controllers/Sql/EnumValuesControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ public function testGetEnumValuesSuccess(): void
104104
$this->assertSame(
105105
[
106106
'dropdown' => '<select>' . "\n"
107-
. ' <option value="">&nbsp;</option>' . "\n"
108107
. ' <option value="&lt;script&gt;alert(&quot;ok&quot;)&lt;/script&gt;">'
109108
. '&lt;script&gt;alert(&quot;ok&quot;)&lt;/script&gt;</option>' . "\n"
110109
. ' <option value="a&amp;b">a&amp;b</option>' . "\n"

test/classes/Stubs/DbiDummy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function selectDb(string|DatabaseName $databaseName, Connection $connecti
115115
return true;
116116
}
117117

118-
Assert::markTestIncomplete('Non expected select of database: ' . $databaseName);
118+
Assert::fail('Non expected select of database: ' . $databaseName);
119119
}
120120

121121
public function assertAllQueriesConsumed(): void
@@ -176,7 +176,7 @@ public function realQuery(string $query, Connection $connection, int $options):
176176
$query = trim((string) preg_replace('/ */', ' ', str_replace("\n", ' ', $query)));
177177
$found = $this->findFifoQuery($query) ?? $this->findDummyQuery($query);
178178
if (! $found) {
179-
Assert::markTestIncomplete('Not supported query: ' . $query);
179+
Assert::fail('Not supported query: ' . $query);
180180
}
181181

182182
if ($found['result'] === false) {

0 commit comments

Comments
 (0)