Skip to content

Commit

Permalink
Fix eof
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonym-tsk committed Oct 23, 2024
1 parent e3c9ca7 commit 9dabfec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/share/www/nfqws/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ function normalizeString(string $s): string {

// Don't allow out-of-control blank lines.
$s = preg_replace("/\n{3,}/", "\n\n", $s);
return $s . "\n";

$lastChar = substr($s, -1);
if ($lastChar !== "\n") {
$s .= "\n";
}

return $s;
}

function getFiles($path = '/opt/etc/nfqws'): array {
Expand Down

0 comments on commit 9dabfec

Please sign in to comment.