Open raikasdev opened 3 months ago
Because we use backslashes and not normal slashes, this escapes the complex string templating and results in the wrong filter name:
$strings[ $key ] = apply_filters( "air_cookie\strings\{$key}", $string );
with key consent_modal_title results in a filter "air_cookie\strings\{consent_modal_title}" being applied.
consent_modal_title
"air_cookie\strings\{consent_modal_title}"
Proper usage would be
$strings[ $key ] = apply_filters( "air_cookie\strings\\{$key}", $string );
As seen on PHP String docs "Complex (curly) syntax" in the last 5 lines of the first code example.
// Won't work, outputs: C:\folder\{fantastic}.txt echo "C:\folder\{$great}.txt" // Works, outputs: C:\folder\fantastic.txt echo "C:\\folder\\{$great}.txt"
Noticed first by @rahkapetteri here.
Seems like I just scanned the message without reading it with thought :face_with_spiral_eyes:, but thanks for pointing this out! Noticed it today when setupping air-cookie for a site.
Because we use backslashes and not normal slashes, this escapes the complex string templating and results in the wrong filter name:
with key
consent_modal_title
results in a filter"air_cookie\strings\{consent_modal_title}"
being applied.Proper usage would be
As seen on PHP String docs "Complex (curly) syntax" in the last 5 lines of the first code example.