Skip to content

Commit a87952a

Browse files
committed
Bug-fix (#5).
Changelog excerpt: - A reconstructed 'signatures.dat', after processing new signature files, should be prefixed by '---'; not by '0: false'. The code wasn't properly accommodating this; Fixed.
1 parent 284edc2 commit a87952a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

SigTool.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public function readIn()
5050
*/
5151
public function setRaw(string $Raw)
5252
{
53+
if (substr($Raw, 0, 4) === "---\n") {
54+
$Raw = substr($Raw, 4);
55+
}
5356
$this->Raw = $Raw;
5457
}
5558

@@ -895,7 +898,7 @@ function ($Matches) use ($Char, $Length) {
895898
/** Update signatures.dat if necessary. */
896899
if (!empty($Meta)) {
897900
echo sprintf($L10N['Writing'], 'signatures.dat');
898-
$NewMeta = $SigTool->reconstruct($SigTool->Arr);
901+
$NewMeta = "---\n" . $SigTool->reconstruct($SigTool->Arr);
899902
$Handle = fopen($SigTool->fixPath(__DIR__ . '/signatures.dat'), 'wb');
900903
fwrite($Handle, $NewMeta);
901904
fclose($Handle);

0 commit comments

Comments
 (0)