From 8efc8a706a6251cf1e2affb2c20d8f2daecfe7dd Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Mon, 22 Mar 2021 23:49:54 -0300 Subject: [PATCH] fix: not sanitize value for Logs #447 --- src/classes/repositories/class-tainacan-repository.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/classes/repositories/class-tainacan-repository.php b/src/classes/repositories/class-tainacan-repository.php index 3a677fcad..0fd2ff66a 100644 --- a/src/classes/repositories/class-tainacan-repository.php +++ b/src/classes/repositories/class-tainacan-repository.php @@ -168,8 +168,11 @@ abstract class Repository { $obj_post_type = 'tainacan-item'; do_action( "tainacan-pre-insert-$obj_post_type", $obj ); } - $obj->WP_Post->post_title = $sanitized_title; - $obj->WP_Post->post_content = $sanitized_desc; + + if ( ! $obj instanceof Entities\Log ) { + $obj->WP_Post->post_title = $sanitized_title; + $obj->WP_Post->post_content = $sanitized_desc; + } $id = wp_insert_post( $obj->WP_Post ); if ($id instanceof \WP_Error || 0 === $id) {