Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two Five Three #518

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/discourse-publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ protected function get_excluded_tag_slugs() {
* @return string
*/
protected function sanitize_title( $title ) {
return wp_specialchars_decode( wp_strip_all_tags( $title ) );
return html_entity_decode( wp_strip_all_tags( $title ), ENT_COMPAT, 'UTF-8' );
}

/**
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: discourse, forum, comments, sso
Requires at least: 5.1
Tested up to: 6.4
Requires PHP: 5.6
Stable tag: 2.5.2
Stable tag: 2.5.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -123,6 +123,10 @@ To create a coherent top menu, see our tutorial on how to make a [Custom nav hea

== Changelog ==

#### 2.5.3 01/05/2024

- Improve HTML entites decoding in titles.

#### 2.5.2 08/04/2024

- Add a 'Disable user creation' setting for the DiscourseConnect Client.
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/test-discourse-publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,8 @@ public function test_force_publish_max_age_prevents_older_posts_from_being_publi
* Test that HTML entities are converted to their special characters.
*/
public function test_conversion_of_html_entities_in_title() {
$title_with_entities = 'Title with &';
$title_with_decoded_entities = 'Title with &';
$title_with_entities = 'Title with & and –';
$title_with_decoded_entities = 'Title with & and –';
self::$post_atts['post_title'] = $title_with_entities;

$response = $this->build_response( 'success' );
Expand Down
4 changes: 2 additions & 2 deletions wp-discourse.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: WP-Discourse
* Description: Use Discourse as a community engine for your WordPress blog
* Version: 2.5.2
* Version: 2.5.3
* Requires at least: 5.1
* Requires PHP: 5.6
* Author: Discourse
Expand Down Expand Up @@ -36,7 +36,7 @@
define( 'WPDISCOURSE_URL', plugins_url( '', __FILE__ ) );
define( 'MIN_WP_VERSION', '4.7' );
define( 'MIN_PHP_VERSION', '5.6.0' );
define( 'WPDISCOURSE_VERSION', '2.5.2' );
define( 'WPDISCOURSE_VERSION', '2.5.3' );
define( 'WPDISCOURSE_LOGO_URL', WPDISCOURSE_PATH . 'assets/icon.svg' );
$base64 = base64_encode( file_get_contents( WPDISCOURSE_LOGO_URL ) );
define( 'WPDISCOURSE_LOGO', "data:image/svg+xml;base64,$base64" );
Expand Down
Loading