kylephillips / favorites

Simple and flexible favorite buttons for any WordPress post type.
https://favoriteposts.com
223 stars 86 forks source link

HTML tags are stripped out when using html for No Favorites Text #181

Open carl-georg1 opened 1 year ago

carl-georg1 commented 1 year ago

We're using html in our No Favorites Text but all the tags gets stripped out. The sanitize_text_field removes the tags, but there's also back slashes which get added somewhere in the JSON.

I've made a temporary fix. But please fix in next release:

FILE:

/favorites/app/Listeners/FavoriteList.php

LINE: 39 $this->data['no_favorites'] = ( isset($_POST['no_favorites']) ) ? sanitize_text_field($_POST['no_favorites']) : '';

Temporary fix:

$this->data['no_favorites'] = ( isset($_POST['no_favorites']) ) ? str_replace('\', '', $_POST['no_favorites']) : '';

See attached screenshots for more info Screenshot 2023-06-06 134610 Screenshot 2023-06-06 183919