Serializing error message to avoid problems with log parser

This commit is contained in:
David Marín 2022-04-22 06:19:52 +02:00
parent eac68cdf50
commit 15aec9e0fa
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ class WC_Log_Handler_DB extends WC_Log_Handler {
try {
$insert['context'] = serialize( $context ); // @codingStandardsIgnoreLine.
} catch ( Exception $e ) {
$insert['context'] = 'There was an error while serializing the context: ' . $e->getMessage();
$insert['context'] = serialize( 'There was an error while serializing the context: ' . $e->getMessage() );
}
}