Skip to content

Commit

Permalink
Revert "fix migratition errors due to empty submission files"
Browse files Browse the repository at this point in the history
This reverts commit 8941b44.
  • Loading branch information
hqy2000 committed Feb 25, 2024
1 parent 30b2606 commit f2f396f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webapp/migrations/Version20210407120356.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ public function up(Schema $schema) : void
for ($idx = 0; $idx < $zip->numFiles; $idx++) {
$filename = basename($zip->getNameIndex($idx));
$content = $zip->getFromIndex($idx);
$encodedContent = ($content === '' ? '0x0A' : ('0x' . strtoupper(bin2hex($content))));
$encodedContent = ($content === '' ? '' : ('0x' . strtoupper(bin2hex($content))));

// In doubt make files executable, but try to read it from the zip file.
$executableBit = '1';
if ($zip->getExternalAttributesIndex($idx, $opsys, $attr)
&& $opsys == ZipArchive::OPSYS_UNIX
&& (($attr >> 16) & 0100) === 0) {
$executableBit = '0';
}

}
$this->connection->executeStatement(
'INSERT INTO executable_file '
. '(`immutable_execid`, `filename`, `ranknumber`, `file_content`, `is_executable`, `hash`) '
Expand Down

0 comments on commit f2f396f

Please sign in to comment.