File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Because the linker is intended for use w
53
53
[ 2023.09.04; Maikuolan] : Added L10N for Afrikaans and Romanian.
54
54
55
55
[ 2023.09.16~ 18; Maikuolan] : Significantly refactored all L10N data.
56
+
57
+ [ 2023.09.18; Maikuolan] : Better resource guarding.
Original file line number Diff line number Diff line change 8
8
* License: GNU/GPLv2
9
9
* @see LICENSE.txt
10
10
*
11
- * This file: PHPMailer-phpMussel linker (last modified: 2022.02.13 ).
11
+ * This file: PHPMailer-phpMussel linker (last modified: 2023.09.18 ).
12
12
*/
13
13
14
14
namespace phpMussel \PHPMailer ;
@@ -81,7 +81,10 @@ public function __construct(\phpMussel\Core\Loader &$Loader)
81
81
82
82
$ Truncate = $ this ->Loader ->readBytes ($ this ->Loader ->Configuration ['core ' ]['truncate ' ]);
83
83
$ WriteMode = (!file_exists ($ EventLog ) || ($ Truncate > 0 && filesize ($ EventLog ) >= $ Truncate )) ? 'wb ' : 'ab ' ;
84
- $ Handle = fopen ($ EventLog , $ WriteMode );
84
+ if (!is_resource ($ Handle = fopen ($ EventLog , $ WriteMode ))) {
85
+ trigger_error ('The "writeToPHPMailerEventLog" event failed to open " ' . $ EventLog . '" for writing. ' );
86
+ return false ;
87
+ }
85
88
fwrite ($ Handle , $ Data );
86
89
fclose ($ Handle );
87
90
$ this ->Loader ->logRotation ($ this ->Loader ->Configuration ['phpmailer ' ]['event_log ' ]);
You can’t perform that action at this time.
0 commit comments