nexcess/magento-turpentine

error function replaceFormKeyPlaceholder in app\code\community\Nexcessnet\Turpentine\Model\Observer\Esi.php

ArnauClickconsulting opened this issue · 0 comments

Hi,

I have an error when generate the wishlist url. This url have the code {{form_key_esi placeholder}}.

I have solved this error modifying the function replaceFormKeyPlaceholder from:
$responseBody = str_replace('{{form_key_esi_placeholder}}',
$esiHelper->buildEsiIncludeFragment(
$esiHelper->getFormKeyEsiUrl() ),
$responseBody);
To:
$formKeyPlaceholder = '{{form_key_esi_placeholder}}';
$encodedFormKeyPlaceholder = rawurlencode($formKeyPlaceholder);
$responseBody = str_replace(
array($formKeyPlaceholder, $encodedFormKeyPlaceholder),
$esiHelper->buildEsiIncludeFragment(
$esiHelper->getFormKeyEsiUrl() ),
$responseBody);

And now it works correctly.
I have reviewed the version of your code but it is the same.
Do you have any solution to do not change your plugin or my solution is correct and you are going to include it?

Thanks,