1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 14:46:36 +02:00

AdminerSqlGemini: Remove extra comments (fix #1075)

This commit is contained in:
Jakub Vrana
2025-06-18 09:36:17 +02:00
parent f24f72ac51
commit 9745c12769

View File

@@ -41,8 +41,8 @@ class AdminerSqlGemini extends Adminer\Plugin {
echo "-- " . $response->error->message;
} else {
$text = $response->candidates[0]->content->parts[0]->text;
$text = preg_replace('~(\n|^)```sql\n(.+)\n```(\n|$)~sU', "*/\n\n\\2\n\n/*", "/*\n$text*/\n");
echo preg_replace('~/\*\s*\*/\n*~', '', $text);
$text2 = preg_replace('~(\n|^)```sql\n(.+)\n```(\n|$)~sU', "*/\n\n\\2\n\n/*", "/*\n$text\n*/", -1, $count);
echo ($count ? preg_replace('~/\*\s*\*/\n*~', '', $text2) : $text);
}
exit;
}