Skip to content

Commit 2c45de8

Browse files
committed
Bug-fix.
Changelog excerpt: - Log truncation not being calculated properly; Fixed.
1 parent 2e1722f commit 2c45de8

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
2323
### v3.1.2
2424

2525
[2021.04.27; Maikuolan]: Added missing fullmoon template file.
26+
27+
[2021.05.01; Bug-fix; Maikuolan]: Log truncation not being calculated properly; Fixed.

src/Web.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: Upload handler (last modified: 2020.10.30).
11+
* This file: Upload handler (last modified: 2021.05.01).
1212
*/
1313

1414
namespace phpMussel\Web;
@@ -115,12 +115,9 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
115115
$Data = \phpMussel\Core\Loader::SAFETY . "\n\n" . $Data;
116116
$WriteMode = 'wb';
117117
} else {
118-
$WriteMode = (
119-
$this->Loader->Configuration['core']['truncate'] > 0 &&
120-
filesize($File) >= $this->Loader->readBytes($this->Loader->Configuration['core']['truncate'])
121-
) ? 'wb' : 'ab';
118+
$Truncate = $this->Loader->readBytes($this->Loader->Configuration['core']['truncate']);
119+
$WriteMode = ($Truncate > 0 && filesize($File) >= $Truncate) ? 'wb' : 'ab';
122120
}
123-
124121
$Stream = fopen($File, $WriteMode);
125122
fwrite($Stream, $Data);
126123
fclose($Stream);

0 commit comments

Comments
 (0)