syamilmj / aqua-page-builder

Aqua Page Builder WordPress Plugin
238 stars 114 forks source link

Shortcodes in Aqua Page Builder block escaped with htmlspecialchars_decode() seems not to work on WordPress 4.6.1 #197

Open monecchi opened 7 years ago

monecchi commented 7 years ago

Hey there. First, It's awesome to manage a theme powered by Aqua Page Builder. Thanks for making it a great plugin!

I've just updated WordPress to version 4.6.1. Before the update, the shortcodes placed on Aqua Page Builder blocks were working as usual.

After the WordPress update I noticed that all the shortcodes are being outputted as expected, BUT they're lacking their attributes, I mean, any attributes manually passed to the shortcodes are being override by their default attributes.

I have no issues with shortcodes in my theme's template files because if I call a shortcode directly by placing a php code in one of my theme's template it works as expected.

E.g.

<?php echo do_shortcode('[su_button url="#" style="btn-success btn-white" target="default" text="Start Now"]'); ?>

My theme templates also outputs the contents of its page blocks fields by using the htmlspecialchars_decode() function, the same way Aqua Page Builder blocks deals with escaping fieds.

I had to change all occurrences of htmlspecialchars_decode() to stripcslashes(), not in the plugin, but on my theme's templates.

Could anyone please help me to understand what's going on here?

Thanks in advance.

monecchi commented 7 years ago

:(

syamilmj commented 7 years ago

Hi monecchi,

I haven't been checking on the updates recently, but it's possible that there were changes that causes this.

If you'd be interested to find the root cause for this and send a PR with a fix that is also backward compatible, that would be a HUGE help. :)