From 92b11a3926bb85e1cb36459040d473ba45cb0d0c Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Wed, 8 Feb 2023 10:06:22 +0100 Subject: [PATCH 01/16] use html version of the link as before --- includes/model/class-post.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/model/class-post.php b/includes/model/class-post.php index 5546c88..b224b82 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -403,15 +403,15 @@ class Post { */ public function get_post_content_template() { if ( 'excerpt' === \get_option( 'activitypub_post_content_type', 'content' ) ) { - return "[ap_excerpt]\n\n[ap_permalink]"; + return "[ap_excerpt]\n\n[ap_permalink type=\"html\"]"; } if ( 'title' === \get_option( 'activitypub_post_content_type', 'content' ) ) { - return "[ap_title]\n\n[ap_permalink]"; + return "[ap_title]\n\n[ap_permalink type=\"html\"]"; } if ( 'content' === \get_option( 'activitypub_post_content_type', 'content' ) ) { - return "[ap_content]\n\n[ap_hashtags]\n\n[ap_permalink]"; + return "[ap_content]\n\n[ap_hashtags]\n\n[ap_permalink type=\"html\"]"; } // Upgrade from old template codes to shortcodes. From 971c6ae5d52a9158678105b021637b414e08286f Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Wed, 8 Feb 2023 13:26:00 +0100 Subject: [PATCH 02/16] update package name --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b06ccaf..741ae18 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "activitypub", + "name": "wordpress-activitypub", "description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.", "repository": { "type": "git", From e2c1dc28b56b67b7cc9c6d21a092e822be84002e Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Thu, 16 Feb 2023 09:12:01 +0100 Subject: [PATCH 03/16] fix #281 --- includes/rest/class-inbox.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 5c21f43..5d6b6ce 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -491,11 +491,21 @@ class Inbox { foreach ( array( 'to', 'bto', 'cc', 'bcc', 'audience' ) as $i ) { if ( array_key_exists( $i, $data ) ) { - $recipient_items = array_merge( $recipient_items, $data[ $i ] ); + if ( is_array( $data[ $i ] ) ) { + $recipient = $data[ $i ]; + } else { + $recipient = array( $data[ $i ] ); + } + $recipient_items = array_merge( $recipient_items, $recipient ); } if ( array_key_exists( $i, $data['object'] ) ) { - $recipient_items = array_merge( $recipient_items, $data[ $i ] ); + if ( is_array( $data['object'][ $i ] ) ) { + $recipient = $data['object'][ $i ]; + } else { + $recipient = array( $data['object'][ $i ] ); + } + $recipient_items = array_merge( $recipient_items, $recipient ); } } From 873066115d2d0a7a9d2a112d6d184ef03ddc4208 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 08:55:23 +0100 Subject: [PATCH 04/16] strip style and script elements --- includes/class-shortcodes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/class-shortcodes.php b/includes/class-shortcodes.php index b6fc4ad..495cb67 100644 --- a/includes/class-shortcodes.php +++ b/includes/class-shortcodes.php @@ -106,7 +106,6 @@ class Shortcodes { // An empty string will make wp_trim_excerpt do stuff we do not want. if ( '' !== $content ) { - $excerpt = \strip_shortcodes( $content ); /** This filter is documented in wp-includes/post-template.php */ @@ -199,6 +198,9 @@ class Shortcodes { $content = \get_post_field( 'post_content', $post ); + // replace script and style elements + $content = \preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $content ); + if ( 'yes' === $atts['apply_filters'] ) { $content = \apply_filters( 'the_content', $content ); } else { From b0149739fa5c947a54b4393b4639cad1b3da0a76 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 08:58:12 +0100 Subject: [PATCH 05/16] remove line breaks --- includes/class-shortcodes.php | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/class-shortcodes.php b/includes/class-shortcodes.php index 495cb67..7ea67b1 100644 --- a/includes/class-shortcodes.php +++ b/includes/class-shortcodes.php @@ -111,7 +111,6 @@ class Shortcodes { /** This filter is documented in wp-includes/post-template.php */ $excerpt = \apply_filters( 'the_content', $excerpt ); $excerpt = \str_replace( ']]>', ']]>', $excerpt ); - } } From 73ae7a5d7513e47fbce1e8b68a93f3c015420356 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 18:08:10 +0100 Subject: [PATCH 06/16] fix content creation and added tests --- docker-compose-test.yml | 1 + includes/class-shortcodes.php | 2 + includes/model/class-post.php | 4 +- tests/test-class-activitypub-rest-inbox.php | 75 +++++++++++++++++++++ tests/test-class-activitypub-shortcodes.php | 30 +++++++++ 5 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 tests/test-class-activitypub-rest-inbox.php create mode 100644 tests/test-class-activitypub-shortcodes.php diff --git a/docker-compose-test.yml b/docker-compose-test.yml index a293823..4c69e44 100644 --- a/docker-compose-test.yml +++ b/docker-compose-test.yml @@ -1,6 +1,7 @@ version: '2' services: test-db: + platform: linux/x86_64 image: mysql:5.7 environment: MYSQL_DATABASE: activitypub-test diff --git a/includes/class-shortcodes.php b/includes/class-shortcodes.php index 7ea67b1..ad2efe5 100644 --- a/includes/class-shortcodes.php +++ b/includes/class-shortcodes.php @@ -208,6 +208,8 @@ class Shortcodes { $content = wp_filter_content_tags( $content ); } + $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); + return $content; } diff --git a/includes/model/class-post.php b/includes/model/class-post.php index b224b82..a431287 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -387,9 +387,7 @@ class Post { $content = \wpautop( \wp_kses( $content, $this->allowed_tags ) ); $filtered_content = \apply_filters( 'activitypub_the_content', $content, $post ); - $decoded_content = \html_entity_decode( $filtered_content, \ENT_QUOTES, 'UTF-8' ); - - $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); + $content = \html_entity_decode( $filtered_content, \ENT_QUOTES, 'UTF-8' ); $this->content = $content; diff --git a/tests/test-class-activitypub-rest-inbox.php b/tests/test-class-activitypub-rest-inbox.php new file mode 100644 index 0000000..58f16f3 --- /dev/null +++ b/tests/test-class-activitypub-rest-inbox.php @@ -0,0 +1,75 @@ +assertEquals( $check, Activitypub\Rest\Inbox::is_activity_public( $data ) ); + } + + public function the_data_provider() { + return array( + array( + array( + 'cc' => array( + 'https://example.org/@test', + 'https://example.com/@test2', + ), + 'to' => 'https://www.w3.org/ns/activitystreams#Public', + 'object' => array(), + ), + true, + ), + array( + array( + 'cc' => array( + 'https://example.org/@test', + 'https://example.com/@test2', + ), + 'to' => array( + 'https://www.w3.org/ns/activitystreams#Public', + ), + 'object' => array(), + ), + true, + ), + array( + array( + 'cc' => array( + 'https://example.org/@test', + 'https://example.com/@test2', + ), + 'object' => array(), + ), + false, + ), + array( + array( + 'cc' => array( + 'https://example.org/@test', + 'https://example.com/@test2', + ), + 'object' => array( + 'to' => 'https://www.w3.org/ns/activitystreams#Public', + ), + ), + true, + ), + array( + array( + 'cc' => array( + 'https://example.org/@test', + 'https://example.com/@test2', + ), + 'object' => array( + 'to' => array( + 'https://www.w3.org/ns/activitystreams#Public', + ), + ), + ), + true, + ), + ); + } +} diff --git a/tests/test-class-activitypub-shortcodes.php b/tests/test-class-activitypub-shortcodes.php new file mode 100644 index 0000000..ac97910 --- /dev/null +++ b/tests/test-class-activitypub-shortcodes.php @@ -0,0 +1,30 @@ +ID = $post_id; + $post->post_author = 1; + $post->post_date = current_time( 'mysql' ); + $post->post_date_gmt = current_time( 'mysql', 1 ); + $post->post_title = 'Some title or other'; + $post->post_content = 'hallo'; + $post->post_status = 'publish'; + $post->comment_status = 'closed'; + $post->ping_status = 'closed'; + $post->post_name = 'fake-page-' . rand( 1, 99999 ); // append random number to avoid clash + $post->post_type = 'page'; + $post->filter = 'raw'; // important! + + $content = '[ap_content]'; + + // Fill in the shortcodes. + setup_postdata( $post ); + $content = do_shortcode( $content ); + wp_reset_postdata(); + + $this->assertEquals( '

hallo

', $content ); + } +} From 21cff7f24b14005a0053cfa1a883f21b571fae28 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 18:17:02 +0100 Subject: [PATCH 07/16] version bump --- README.md | 7 ++++++- activitypub.php | 2 +- includes/model/class-post.php | 5 +++-- readme.txt | 7 ++++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9de8b8f..a0ba36f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 6.1 -**Stable tag:** 0.16.2 +**Stable tag:** 0.16.3 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -88,6 +88,11 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### 0.16.3 ### + +* "cc", "to", ... fields can either be an array or a string +* Remove "style" and "script" HTML elements from content + ### 0.16.2 ### * Fix fatal error in outbox diff --git a/activitypub.php b/activitypub.php index d30bf3f..92a2aa7 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.16.2 + * Version: 0.16.3 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT diff --git a/includes/model/class-post.php b/includes/model/class-post.php index a431287..2197a83 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -385,9 +385,10 @@ class Post { wp_reset_postdata(); $content = \wpautop( \wp_kses( $content, $this->allowed_tags ) ); + $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); - $filtered_content = \apply_filters( 'activitypub_the_content', $content, $post ); - $content = \html_entity_decode( $filtered_content, \ENT_QUOTES, 'UTF-8' ); + $content = \apply_filters( 'activitypub_the_content', $content, $post ); + $content = \html_entity_decode( $content, \ENT_QUOTES, 'UTF-8' ); $this->content = $content; diff --git a/readme.txt b/readme.txt index ad6ad3d..387ed30 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: 6.1 -Stable tag: 0.16.2 +Stable tag: 0.16.3 Requires PHP: 5.6 License: MIT License URI: http://opensource.org/licenses/MIT @@ -88,6 +88,11 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). += 0.16.3 = + +* "cc", "to", ... fields can either be an array or a string +* Remove "style" and "script" HTML elements from content + = 0.16.2 = * Fix fatal error in outbox From 9b642858f6294ef0193c4b2b65bbfc43e21c6ca7 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 18:42:00 +0100 Subject: [PATCH 08/16] add user registration date as published fix #276 --- templates/author-json.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/author-json.php b/templates/author-json.php index 8c5951c..1003989 100644 --- a/templates/author-json.php +++ b/templates/author-json.php @@ -19,6 +19,8 @@ $json->icon = array( 'url' => \get_avatar_url( $author_id, array( 'size' => 120 ) ), ); +$json->published = \gmdate( 'Y-m-d\TH:i:s\Z', \strtotime( \get_the_author_meta( 'registered', $author_id ) ) ); + if ( \has_header_image() ) { $json->image = array( 'type' => 'Image', From 72f12de96a7c103a705ef3f52c6ab3a1d0df3dda Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 21:18:03 +0100 Subject: [PATCH 09/16] remove scripts later in the queue --- includes/class-shortcodes.php | 6 +++--- tests/test-class-activitypub-shortcodes.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/class-shortcodes.php b/includes/class-shortcodes.php index ad2efe5..da2488a 100644 --- a/includes/class-shortcodes.php +++ b/includes/class-shortcodes.php @@ -197,9 +197,6 @@ class Shortcodes { $content = \get_post_field( 'post_content', $post ); - // replace script and style elements - $content = \preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $content ); - if ( 'yes' === $atts['apply_filters'] ) { $content = \apply_filters( 'the_content', $content ); } else { @@ -208,6 +205,9 @@ class Shortcodes { $content = wp_filter_content_tags( $content ); } + // replace script and style elements + $content = \preg_replace( '@<(script|style)[^>]*?>.*?@si', '', $content ); + $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); return $content; diff --git a/tests/test-class-activitypub-shortcodes.php b/tests/test-class-activitypub-shortcodes.php index ac97910..9459141 100644 --- a/tests/test-class-activitypub-shortcodes.php +++ b/tests/test-class-activitypub-shortcodes.php @@ -10,7 +10,7 @@ class Test_Activitypub_Shortcodes extends WP_UnitTestCase { $post->post_date = current_time( 'mysql' ); $post->post_date_gmt = current_time( 'mysql', 1 ); $post->post_title = 'Some title or other'; - $post->post_content = 'hallo'; + $post->post_content = 'hallo'; $post->post_status = 'publish'; $post->comment_status = 'closed'; $post->ping_status = 'closed'; From 62ef84aff7a612a0c1b3d8e6ba17d0c0247d7c23 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 20 Feb 2023 21:19:52 +0100 Subject: [PATCH 10/16] version bump --- README.md | 7 ++++++- activitypub.php | 2 +- readme.txt | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a0ba36f..3cecdd9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 6.1 -**Stable tag:** 0.16.3 +**Stable tag:** 0.16.4 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -88,6 +88,11 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### 0.16.4 ### + +* Remove scripts later in the queue, to also handle scripts added by blocks +* Add published date to author profiles + ### 0.16.3 ### * "cc", "to", ... fields can either be an array or a string diff --git a/activitypub.php b/activitypub.php index 92a2aa7..5a19395 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.16.3 + * Version: 0.16.4 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT diff --git a/readme.txt b/readme.txt index 387ed30..90415c4 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: 6.1 -Stable tag: 0.16.3 +Stable tag: 0.16.4 Requires PHP: 5.6 License: MIT License URI: http://opensource.org/licenses/MIT @@ -88,6 +88,11 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). += 0.16.4 = + +* Remove scripts later in the queue, to also handle scripts added by blocks +* Add published date to author profiles + = 0.16.3 = * "cc", "to", ... fields can either be an array or a string From 2274bd007493bc4cbc39dcac91c28be9bd8c7d3d Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 27 Feb 2023 08:15:02 +0100 Subject: [PATCH 11/16] check if post is password protected --- includes/class-shortcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-shortcodes.php b/includes/class-shortcodes.php index da2488a..7289808 100644 --- a/includes/class-shortcodes.php +++ b/includes/class-shortcodes.php @@ -82,7 +82,7 @@ class Shortcodes { public static function excerpt( $atts, $content, $tag ) { $post = get_post(); - if ( ! $post ) { + if ( ! $post || \post_password_required( $post ) ) { return ''; } @@ -185,7 +185,7 @@ class Shortcodes { public static function content( $atts, $content, $tag ) { $post = get_post(); - if ( ! $post ) { + if ( ! $post || \post_password_required( $post ) ) { return ''; } From c0cb540c4d9649bc98cc8405bbd27f452d5ae5b3 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Thu, 2 Mar 2023 09:54:52 +0100 Subject: [PATCH 12/16] Fix handling of password protected posts --- README.md | 6 ++++- activitypub.php | 2 +- readme.txt | 6 ++++- tests/test-class-activitypub-shortcodes.php | 29 +++++++++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3cecdd9..33a14f5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 6.1 -**Stable tag:** 0.16.4 +**Stable tag:** 0.16.5 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -88,6 +88,10 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### 0.16.5 ### + +* Return empty content/excerpt on password protected posts/pages + ### 0.16.4 ### * Remove scripts later in the queue, to also handle scripts added by blocks diff --git a/activitypub.php b/activitypub.php index 5a19395..853203c 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.16.4 + * Version: 0.16.5 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT diff --git a/readme.txt b/readme.txt index 90415c4..b5c4be3 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: 6.1 -Stable tag: 0.16.4 +Stable tag: 0.16.5 Requires PHP: 5.6 License: MIT License URI: http://opensource.org/licenses/MIT @@ -88,6 +88,10 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). += 0.16.5 = + +* Return empty content/excerpt on password protected posts/pages + = 0.16.4 = * Remove scripts later in the queue, to also handle scripts added by blocks diff --git a/tests/test-class-activitypub-shortcodes.php b/tests/test-class-activitypub-shortcodes.php index 9459141..5ba69d9 100644 --- a/tests/test-class-activitypub-shortcodes.php +++ b/tests/test-class-activitypub-shortcodes.php @@ -27,4 +27,33 @@ class Test_Activitypub_Shortcodes extends WP_UnitTestCase { $this->assertEquals( '

hallo

', $content ); } + + public function test_password_protected_content() { + global $post; + + $post_id = -98; // negative ID, to avoid clash with a valid post + $post = new stdClass(); + $post->ID = $post_id; + $post->post_author = 1; + $post->post_date = current_time( 'mysql' ); + $post->post_date_gmt = current_time( 'mysql', 1 ); + $post->post_title = 'Some title or other'; + $post->post_content = 'hallo'; + $post->post_status = 'publish'; + $post->comment_status = 'closed'; + $post->ping_status = 'closed'; + $post->post_name = 'fake-page-' . rand( 1, 99999 ); // append random number to avoid clash + $post->post_type = 'page'; + $post->post_password = 'abc'; + $post->filter = 'raw'; // important! + + $content = '[ap_content]'; + + // Fill in the shortcodes. + setup_postdata( $post ); + $content = do_shortcode( $content ); + wp_reset_postdata(); + + $this->assertEquals( '', $content ); + } } From 753f964ce998fec753b7926ef93bd0985aff8df1 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 3 Mar 2023 08:55:23 +0100 Subject: [PATCH 13/16] fix #286 --- includes/model/class-post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/model/class-post.php b/includes/model/class-post.php index 2197a83..61047f0 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -61,7 +61,7 @@ class Post { * * @var string */ - private $object_type = 'Note'; + private $object_type; /** * The Allowed Tags, used in the content. From c99d25b12ef0c414c5fcf6d1a0ba041d0bd25ed9 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 3 Mar 2023 08:56:15 +0100 Subject: [PATCH 14/16] whitelist more html elements fix #285 --- includes/model/class-post.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/includes/model/class-post.php b/includes/model/class-post.php index 61047f0..d83384e 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -85,6 +85,23 @@ class Post { 'div' => array( 'class' => array(), ), + 'ul' => array(), + 'ol' => array(), + 'li' => array(), + 'strong' => array( + 'class' => array(), + ), + 'b' => array( + 'class' => array(), + ), + 'i' => array( + 'class' => array(), + ), + 'em' => array( + 'class' => array(), + ), + 'blockquote' => array(), + 'cite' => array(), ); /** From 5f1859275b8fa6683783f3645719ba165591d18b Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 3 Mar 2023 09:06:43 +0100 Subject: [PATCH 15/16] version bump --- README.md | 7 ++++++- activitypub.php | 2 +- readme.txt | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 33a14f5..1ef7ea7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 6.1 -**Stable tag:** 0.16.5 +**Stable tag:** 0.17.0 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -88,6 +88,11 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### 0.17.0 ### + +* Fix type-selector +* Allow more HTML elements in Activity-Objects + ### 0.16.5 ### * Return empty content/excerpt on password protected posts/pages diff --git a/activitypub.php b/activitypub.php index 853203c..b72901b 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.16.5 + * Version: 0.17.0 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT diff --git a/readme.txt b/readme.txt index b5c4be3..463fd79 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: 6.1 -Stable tag: 0.16.5 +Stable tag: 0.17.0 Requires PHP: 5.6 License: MIT License URI: http://opensource.org/licenses/MIT @@ -88,6 +88,11 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). += 0.17.0 = + +* Fix type-selector +* Allow more HTML elements in Activity-Objects + = 0.16.5 = * Return empty content/excerpt on password protected posts/pages From ced22eebf2236f9464b702423e2655c686a94074 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 7 Mar 2023 19:40:47 +0100 Subject: [PATCH 16/16] remove donation link --- README.md | 3 +-- readme.txt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ef7ea7..969f562 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # ActivityPub # -**Contributors:** [pfefferle](https://profiles.wordpress.org/pfefferle/), [mediaformat](https://profiles.wordpress.org/mediaformat/), [akirk](https://profiles.wordpress.org/akirk/) -**Donate link:** https://notiz.blog/donate/ +**Contributors:** [pfefferle](https://profiles.wordpress.org/pfefferle/), [mediaformat](https://profiles.wordpress.org/mediaformat/), [akirk](https://profiles.wordpress.org/akirk/), [automattic](https://profiles.wordpress.org/automattic/) **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 6.1 diff --git a/readme.txt b/readme.txt index 463fd79..63e1f6a 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,5 @@ === ActivityPub === -Contributors: pfefferle, mediaformat, akirk -Donate link: https://notiz.blog/donate/ +Contributors: pfefferle, mediaformat, akirk, automattic Tags: OStatus, fediverse, activitypub, activitystream Requires at least: 4.7 Tested up to: 6.1