Error with meta-boxes php line 322

Hi there,

I receive a strange php error out of meta-boxes php on line 322 during saving of any changed page. X is up to date.

Stated below, you can see the error message.
I verified the origin of error with simply excluding the function function x_save_meta_box( $post_id ). Working perfectly without for now.

Since it worked fine for some weeks, I am wondering where the cause is and how I can repair the code or how to detect any other error.

Many thanks in advance
Sebastian

ERROR MESSAGE when saving any page:

Warning: htmlspecialchars(): charset `rop-in as an external object cache. * * […]since 3.0.0 * @access private * * […]global array $wp_filter Stores all of the filters. */’ not supported, assuming utf-8 in […]meta-boxes .php on line 322
[…]

Warning: Cannot modify header information - headers already sent by (output started at […]meta-boxes.php:322) in […]pluggable.php on line 1219

above I needed to remove @ and main part of path for posting.

Hello There,

Thanks for writing in! I am not sure where did the message came from. It could possible be from a plugin. All I see is a PHP message which you do not have to worry about. you can get rid of the message by disabling the debug mode. You can do this by opening wp-config.php and adding

define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

When you revisit the page, you should no longer be seeing those PHP warning.

By the way, I have check the site associated with your license and I noticed that you have inserted this:

<div id="bgover"><img src=http://beta.bjoernbuerger.com/wp-content/uploads/2018/09/bgnover.png alt=""></div>

in the custom JS section which is in correct. Please remove it because it resulted to a JS error on the page which may affect your site features.

Thank you.

Hi Thanks!

debug is turned off but that dont change anything.

I still receive the error, see below.
Thanks yes I forgot sth in global blocks.

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: htmlspecialchars(): charset `d.’ not supported, assuming utf-8 in /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php on line 322

Warning: Cannot modify header information - headers already sent by (output started at /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php:322) in /var/www/web866/html/bbuerger/wp-admin/post.php on line 198

Warning: Cannot modify header information - headers already sent by (output started at /var/www/web866/html/bbuerger/wp-content/themes/x/framework/functions/admin/meta-boxes.php:322) in /var/www/web866/html/bbuerger/wp-includes/pluggable.php on line 1219

…And now one more, appearing in email form plugin within x theme.
I ve no idea…

Cheers
Sebastian

Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/web866/html/bbuerger/wp-content/plugins/tco-email-forms/email-integration/functions/custom-fields-metabox.php on line 53

Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/web866/html/bbuerger/wp-content/plugins/tco-email-forms/email-integration/functions/custom-fields-metabox.php on line 53

Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/web866/html/bbuerger/wp-content/plugins/tco-email-forms/email-integration/functions/custom-fields-metabox.php on line 53

Add custom fields from your provider.

As far as I understand it comes from htmlspecialchars( $val ) as per function below in x themes functions:

function x_save_meta_box( $post_id ) {

if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE )
return;

if ( ! isset( $_POST[‘x_meta’] ) || ! isset( $_POST[‘x_meta_box_nonce’] ) || ! wp_verify_nonce( $_POST[‘x_meta_box_nonce’], basename( FILE ) ) )
return;

if ( ‘page’ == $_POST[‘post_type’] ) {
if ( ! current_user_can( ‘edit_page’, $post_id ) ) return;
} else {
if ( ! current_user_can( ‘edit_post’, $post_id ) ) return;
}

foreach( $_POST[‘x_meta’] as $key => $val ) {
if ( is_array( $val ) ) {
update_post_meta( $post_id, $key, $val );
} else {
update_post_meta( $post_id, $key, stripslashes( htmlspecialchars( $val ) ) );
}
}

}

Hi Sebastian,

I tried turning on wp debug on my test sites but didn’t get these warnings .

Can you check and make sure you have at least php version 5.6 installed in your server.

If that doesn’t help please provide wordpress admin login and ftp login in Secure Note

Thanks

Hi Paul,

server is running php 5.6 - i already tried to use current version but that didn’t change anything.
I will send you login data as requested, many thanks for your assistance!

Hi @sdierkes,

Would you mind providing the following in the secure note?

  1. Site’s URL
  2. Admin login credentials
  3. FTP login credentials

And those aren’t errors, but just warning which is usually displaying if WP_DEBUG is set to true, or your hosting provider is forcing the error_reporting to ALL.

For the meantime, please check if your site’s wp-config.php's WP_DEBUG is set to false, and please check this https://www.hostinger.com/how-to/how-to-turn-off-php-error-reporting#gref

Thanks!

Hi @sdierkes,

Have you fixed it, I don’t see any warnings anymore. I also added this line to your site’s wp-config.php

error_reporting(0);

Thanks!

Hi, whow! It s running! I will check later in detail and come back to you.
Thx
Sebastian

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.