Parse error: syntax error, unexpected end of file in /vhosts/.../html/wp-content/plugins/qenta-checkout-seamless-old/woocommerce-qenta-checkout-seamless.php on line 242
FIX:
Line 242 where the string end of string JSCODE is defined, must not be indented
function add_qenta_storage_check()
{
// this is to be added to the footer, see wp_register_script arguments
wp_register_script('qentaStorageCheckJS', '', [], '', true);
$jsQentaStorageCheck = <<<JSCODE
if ( 'undefined' != typeof QentaCEE_DataStorage ) {
const originalMethod = QentaCEE_DataStorage.prototype.storePaymentInformation;
QentaCEE_DataStorage.prototype.storePaymentInformation = function( paymentInformation, callback ) {
if ( 'undefined' != typeof this.iframes && this.iframes.CCARD && ! this.iframes.CCARD.contentWindow ) {
this.iframes.CCARD = document.querySelector('iframe');
}
return originalMethod.apply( this, arguments );
}
}
JSCODE; /// <<<
The closing identifier may be indented by space or tab, in which case the indentation will be stripped from all lines in the doc string. Prior to PHP 7.3.0, the closing identifier must begin in the first column of the line.
Thank you for this detailed description. Although PHP version 7.2 is not supported we added the proposed fix to the latest maintenance release available on the Releases Page.
Prerequisites
Versions
WooCommerce version: 5.9 PHP version: 7.2
Issue
Problem description:
Plugin can not be activated due an fatal error
FIX:
Line 242 where the string end of string
JSCODE
is defined, must not be indentedsee https://www.php.net/manual/de/language.types.string.php#language.types.string.syntax.heredoc
Steps to reproduce: