Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#55304 closed enhancement (invalid)

Remove error logging in sanitize_post

Reported by: legalweb's profile legalweb Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.9.1
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

There is a error_log call in the method sanitize_post in post.php which is not needed in generall. it only spams the debug.log file

<?php
foreach ( array_keys( get_object_vars( $post ) ) as $field ) {
                        error_log("sanitize_post_field(field: ".$field.", postId:".$post->ID.")");
                        $post->$field = sanitize_post_field( $field, $post->$field, $post->ID, $context );
                }

Change History (2)

#1 @swissspidy
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Could it be that this file was manually edited on your site?

This function does not include any error_log() call in WordPress.

See https://github.com/WordPress/wordpress-develop/blob/b28dcfd83243459e9cc08f46f70418ebfde9dde8/src/wp-includes/post.php#L2711-L2723

#2 @legalweb
3 years ago

hi!

i've checked it and have this line on 2 different installations on the same hoster. but if i check the lastet wordpress zip package, it's not present.
seems that the hoster added this. sorry for this false positive.

Note: See TracTickets for help on using tickets.