Skip to content

Commit 8cf3e5a

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2 parents 43ebb1b + ba5533c commit 8cf3e5a

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11252,7 +11252,7 @@ parameters:
1125211252

1125311253
-
1125411254
message: "#^Method PhpMyAdmin\\\\Plugins\\\\Import\\\\ImportSql\\:\\:doImport\\(\\) should return array\\<string\\> but returns mixed\\.$#"
11255-
count: 1
11255+
count: 2
1125611256
path: src/Plugins/Import/ImportSql.php
1125711257

1125811258
-

src/Controllers/HomeController.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,13 @@ public function __invoke(ServerRequest $request): Response|null
108108
$hasServer = Current::$server > 0 || count($config->settings['Servers']) > 1;
109109
if ($hasServer) {
110110
$hasServerSelection = $config->settings['ServerDefault'] == 0
111-
|| (! $config->settings['NavigationDisplayServers']
112-
&& (count($config->settings['Servers']) > 1
113-
|| (Current::$server === 0 && count($config->settings['Servers']) === 1)));
111+
|| (
112+
$config->settings['NavigationDisplayServers']
113+
&& (
114+
count($config->settings['Servers']) > 1
115+
|| (Current::$server === 0 && count($config->settings['Servers']) === 1)
116+
)
117+
);
114118
if ($hasServerSelection) {
115119
$serverSelection = Select::render(true);
116120
}

src/Import/Import.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,15 @@ public function runQuery(string $sql, array &$sqlData): void
219219

220220
foreach ($queries as $query) {
221221
$this->executeQuery($query, $sqlData);
222+
if ($GLOBALS['error']) {
223+
break;
224+
}
222225
}
223226
}
224227

225-
$this->executeQuery($this->importRunBuffer, $sqlData);
228+
if (! $GLOBALS['error']) {
229+
$this->executeQuery($this->importRunBuffer, $sqlData);
230+
}
226231
}
227232

228233
// check length of query unless we decided to pass it to /sql

src/Plugins/Import/ImportSql.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ public function doImport(File|null $importHandle = null): array
157157
$this->import->runQuery($statement, $sqlStatements);
158158
}
159159

160+
if ($GLOBALS['error']) {
161+
return $sqlStatements;
162+
}
163+
160164
// Finishing.
161165
$this->import->runQuery('', $sqlStatements);
162166

0 commit comments

Comments
 (0)