Skip to content

Commit 008a52a

Browse files
authored
Merge pull request #9 from mt-support/fix/printf-formatting
Adjust error logging to better handle special characters in log messages
2 parents 7d6c01c + 54b431b commit 008a52a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

readme.txt

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ We're always interested in your feedback and our [Help Desk](https://support.the
4141

4242
* Feature - Add the `tec_labs_wpai_is_post_type_set` filter to allow force importing when the post type is not defined in the source.
4343
* Tweak - Add more details to some log messages.
44+
* Tweak - Adjust error logging to better handle special characters in log messages. (Props to Rob Gabaree.)
4445

4546
= [1.0.0] 2023-10-17 =
4647

src/TEC/Import/Post_Handler.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,9 @@ public function modify_tracked_meta_keys( array $tracked_keys ): array {
11801180
*/
11811181
function add_to_log( string $message ): void {
11821182
printf(
1183-
"<div class='progress-msg tec-labs-migration-add-on'><span style='color: #334aff;'>[%s] TEC - $message</span></div>",
1184-
date( "H:i:s" )
1183+
'<div class="progress-msg tec-labs-migration-add-on"><span style="color: #334aff;">[%1$s] TEC - %2$s</span></div>',
1184+
date( "H:i:s" ),
1185+
$message
11851186
);
11861187
flush();
11871188
}

0 commit comments

Comments
 (0)