Skip to content

Commit 4a49df4

Browse files
staabmondrejmirtes
authored andcommitted
FileCacheStorage: Don't use sprintf() on maybe huge strings
1 parent 5574395 commit 4a49df4

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/Cache/FileCacheStorage.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ public function save(string $key, string $variableKey, $data): void
8282
}
8383
FileWriter::write(
8484
$tmpPath,
85-
sprintf(
86-
"<?php declare(strict_types = 1);\n\n%s\nreturn %s;",
87-
sprintf('// %s', $key),
88-
$exported,
89-
),
85+
"<?php declare(strict_types = 1);\n\n" . '// ' . $key . "\nreturn " . $exported . ';',
9086
);
9187

9288
$renameSuccess = @rename($tmpPath, $path);

0 commit comments

Comments
 (0)