' );
- return trim( preg_replace( '/[\r\n]{2,}/', "\n\n", strip_tags( $decoded_summary, $allowed_html) ) );
+ return trim( preg_replace( '/[\r\n]{2,}/', '', strip_tags( $decoded_summary, $allowed_html) ) );
}
public static function add_backlink( $content, $post ) {
@@ -296,6 +296,6 @@ class Activitypub_Post {
$link = esc_url( get_permalink( $post->ID ) );
}
- return $content . "\n\n" . '' . $link . '';
+ return $content . '
' . $link . '
';
}
}
diff --git a/languages/activitypub.pot b/languages/activitypub.pot
index 3dfc702..29f01e7 100644
--- a/languages/activitypub.pot
+++ b/languages/activitypub.pot
@@ -2,9 +2,9 @@
# This file is distributed under the MIT.
msgid ""
msgstr ""
-"Project-Id-Version: ActivityPub 0.3.0\n"
+"Project-Id-Version: ActivityPub 0.3.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/activitypub\n"
-"POT-Creation-Date: 2019-02-02 22:55:56+00:00\n"
+"POT-Creation-Date: 2019-02-02 23:38:20+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
diff --git a/readme.txt b/readme.txt
index 5b14f93..fd941ff 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Donate link: https://notiz.blog/donate/
Tags: OStatus, fediverse, activitypub, activitystream
Requires at least: 4.7
Tested up to: 5.1.0
-Stable tag: 0.3.0
+Stable tag: 0.3.1
Requires PHP: 5.6
License: MIT
License URI: http://opensource.org/licenses/MIT
@@ -55,11 +55,15 @@ To implement:
Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub).
+= 0.3.1 =
+
+* better json encoding
+
= 0.3.0 =
-* basic hashtag support
-* temporarily deactived likes and boosts
-* added support for actor objects
+* basic hashtag support
+* temporarily deactived likes and boosts
+* added support for actor objects
* fixed encoding issue
= 0.2.1 =
diff --git a/templates/json-author.php b/templates/json-author.php
index 809deb4..fcd6fc6 100644
--- a/templates/json-author.php
+++ b/templates/json-author.php
@@ -93,7 +93,7 @@ if ( get_query_var( 'pretty' ) ) {
$options |= JSON_PRETTY_PRINT; // phpcs:ignore
}
-$options |= JSON_UNESCAPED_UNICODE;
+$options |= JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT;
/*
* Options to be passed to json_encode()
diff --git a/templates/json-post.php b/templates/json-post.php
index 38a4cdb..e600270 100644
--- a/templates/json-post.php
+++ b/templates/json-post.php
@@ -19,7 +19,7 @@ if ( get_query_var( 'pretty' ) ) {
$options |= JSON_PRETTY_PRINT; // phpcs:ignore
}
-$options |= JSON_UNESCAPED_UNICODE;
+$options |= JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_QUOT;
/*
* Options to be passed to json_encode()