I searched a lot and I couldn't find a similar error somewhere else. I have this error in my eshop whenever I am in the payment page and cancel the procedure. Then I redirect to this error instead of the shop page. After the error, the whole Woocommerce part of the website is not functional and I have to clear Browser history/cookies and run it again.
Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in /var/www/vhosts/th16529w21.vorschauseite.eu/tourist/wp-includes/kses.php on line 1245
And this is the part of the kses.php
that mentioned above:
function wp_kses_no_null( $string, $options = null ) {
if ( ! isset( $options['slash_zero'] ) ) {
$options = array( 'slash_zero' => 'remove' );
}
$string = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $string ); //line 1245
if ( 'remove' == $options['slash_zero'] ) {
$string = preg_replace( '/\\\\+0+/', '', $string );
}
return $string;
}
Edit: I use the plugin wirecard payment gateway for the payment. And the error raised on cancelation of the payment on this plugin.
I added an if statement to check if the $string
is a string and if not print_r
the variable to see what it is. This is the output:
__PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => Customweb_Payment_Authorization_ErrorMessage [userMessage:Customweb_Payment_Authorization_ErrorMessage:private] => Customweb_I18n_LocalizableString Object ( [string:Customweb_I18n_LocalizableString:private] => Payment processing canceled by customer. [arguments:Customweb_I18n_LocalizableString:private] => Array ( ) ) [backendMessage:Customweb_Payment_Authorization_ErrorMessage:private] => )