Fatal Error after upgrade to 6.6.0 (+ my fix)
-
After upgrading Woocommerce 6.6.0, I got the following error:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Automattic\\WooCommerce\\Internal\\Utilities\\HtmlSanitizer::sanitize() must be of the type string, null given, called in /var/www/wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php on line 308 and defined in /var/www/wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/HtmlSanitizer.php:51
It was an easy enough fix. In ~/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php, I just changed:
/** * Return the gateway's title. * * @return string */ public function get_title() { $title = wc_get_container()->get( HtmlSanitizer::class )->sanitize( $this->title, HtmlSanitizer::LOW_HTML_BALANCED_TAGS_NO_LINKS ); return apply_filters( 'woocommerce_gateway_title', $title, $this->id ); }
to this:
/** * Return the gateway's title. * * @return string */ public function get_title() { $title = wc_get_container()->get( HtmlSanitizer::class )->sanitize( strval($this->title), HtmlSanitizer::LOW_HTML_BALANCED_TAGS_NO_LINKS ); return apply_filters( 'woocommerce_gateway_title', $title, $this->id ); }
Just thought it may be of interest.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Fatal Error after upgrade to 6.6.0 (+ my fix)’ is closed to new replies.