Plugin update triggers fatal error

[ad_1]

Hi @tmpete,

Thank you for providing the error message. It appears that the issue is caused by a type error. The error message indicates that the implode() function is being called with a string as its second argument, while it expects an array.

I have updated plugin with 1.1.8 version.

However, if you have access to the following file: /htdocs/wp1033564_9MD5WDX7NZ/www/staging/wp-content/plugins/enable-cors/src/Helpers/Cors.php, you can resolve this issue by making the following changes to lines 124-129 in the code:

if ( array_key_exists( 'allowedMethods', $options ) ) {
				header( 'Access-Control-Allow-Methods: ' . is_array( $options['allowedMethods'] ) === 1 ? implode( ',', $options['allowedMethods'] ) : $options['allowedMethods'] );
			}
			if ( array_key_exists( 'allowedHeader', $options ) ) {
				header( 'Access-Control-Allow-Headers: ' . is_array( $options['allowedHeader'] ) === 1 ? implode( ', ', $options['allowedHeader'] ) : $options['allowedHeader'] );
			}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer