Thread Starter
Anonymous User 18727274
(@anonymized-18727274)
the problem is that $background_content variable on line 276 is not escaped properly.
-
This reply was modified 4 years, 5 months ago by
Anonymous User 18727274.
@dianfishekqi sorry for the issue. I assume you are trying to create a video slide? Can you give more information, as we are not yet able to reproduce it, despite your help with the log. Also I assume you are using php8? We went over the lines 276, 280. Where do you see the not properly escaped variable? Maybe I am just blind?
Thread Starter
Anonymous User 18727274
(@anonymized-18727274)
Hello there,
Yes I’m using php 8.0, I’ve encounter this issue when one of the colleagues edited a Gutenberg slider after that the edit page would throw a fatal error. He was working on some banners involving a sale therefore he might have used %.
I’ve noticed that $background_content is being concatenated here, after doing a naive escape with str_replace('%','%%') the page was restored which led me to believe that that was the problem.
$background_div = sprintf(
'<div class="%2$s">'
.$background_content
. '<div class="eedee-background-div__overlay" style="%1$s"></div>'
. '</div>',
$background_overlay_style,
$background_classes
);
WooCommerce log related with the incident:
https://pastebin.com/6gZ0YcxB
-
This reply was modified 4 years, 5 months ago by
Anonymous User 18727274.
Thread Starter
Anonymous User 18727274
(@anonymized-18727274)
The same error happened again, I think $background_content is the culprit,
changing
$background_div = sprintf(
'<div class="%2$s">'
.$background_content
. '<div class="eedee-background-div__overlay" style="%1$s"></div>'
. '</div>',
$background_overlay_style,
$background_classes
);
to
$background_div = sprintf(
'<div class="%2$s">'
. '%3$s'
. '<div class="eedee-background-div__overlay" style="%1$s"></div>'
. '</div>',
$background_overlay_style,
$background_classes,
$background_content
);
fixed the problem
Oh sorry we did not get back to you again. We will fix it in the next release and thank you for the code fix.