fix: UTF-8 BOM in update SQL files causing MariaDB syntax error
PowerShell 5.1 Out-File -Encoding UTF8 adds BOM (EF BB BF) which breaks SQL execution on production. Also fix manifest JSON serializing full PS objects instead of plain strings. - build-update.ps1: use UTF8Encoding($false) for all file writes - build-update.ps1: force .ToString() on Get-Content results - UpdateRepository.php: strip BOM and normalize line endings in executeSql - Rebuild ver_0.304 package files (clean SQL + manifest) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -416,7 +416,12 @@ class UpdateRepository
|
||||
return $log;
|
||||
}
|
||||
|
||||
$queries = explode( PHP_EOL, $response );
|
||||
// Usunięcie UTF-8 BOM i normalizacja końców linii
|
||||
$response = ltrim( $response, "\xEF\xBB\xBF" );
|
||||
$response = str_replace( "\r\n", "\n", $response );
|
||||
$response = str_replace( "\r", "\n", $response );
|
||||
|
||||
$queries = explode( "\n", $response );
|
||||
$log[] = '[OK] Pobrano ' . count( $queries ) . ' zapytań SQL';
|
||||
$success = 0;
|
||||
$errors = 0;
|
||||
|
||||
Reference in New Issue
Block a user