Changeset 3451039
- Timestamp:
- 01/31/2026 02:49:52 PM (2 months ago)
- Location:
- share-on-mastodon
- Files:
-
- 8 edited
- 1 copied
-
tags/0.20.1 (copied) (copied from share-on-mastodon/trunk)
-
tags/0.20.1/includes/class-post-handler.php (modified) (5 diffs)
-
tags/0.20.1/includes/class-share-on-mastodon.php (modified) (1 diff)
-
tags/0.20.1/readme.txt (modified) (2 diffs)
-
tags/0.20.1/share-on-mastodon.php (modified) (1 diff)
-
trunk/includes/class-post-handler.php (modified) (5 diffs)
-
trunk/includes/class-share-on-mastodon.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/share-on-mastodon.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
share-on-mastodon/tags/0.20.1/includes/class-post-handler.php
r3378001 r3451039 59 59 // Sanitize custom status, if any. 60 60 if ( isset( $_POST['share_on_mastodon_status'] ) ) { 61 $status = sanitize_textarea_field( wp_unslash( $_POST['share_on_mastodon_status'] ) ); 62 $status = preg_replace( '~\R~u', "\r\n", $status ); 61 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 62 $status = str_replace( '%category%', '%yrogetac%', wp_unslash( $_POST['share_on_mastodon_status'] ) ); 63 $status = sanitize_textarea_field( $status ); // Sanitize after having replaced `%category%` to prevent WP from stripping out `%ca`. 64 $status = str_replace( '%yrogetac%', '%category%', $status ); // Undo what we did before. 65 $status = preg_replace( '~\R~u', "\r\n", $status ); // Normalize line endings. 63 66 } 64 67 … … 80 83 81 84 if ( ! empty( $content_warning ) && '' !== preg_replace( '~\s~', '', $content_warning ) ) { 82 // Save only if `$content_warning` is non-empty and.85 // Save only if `$content_warning` is non-empty. 83 86 update_post_meta( $post->ID, '_share_on_mastodon_cw', $content_warning ); 84 87 } else { … … 567 570 $status = sanitize_textarea_field( $status ); // Strips HTML and whatnot. 568 571 569 // Add the (escaped) URL after theeverything else has been sanitized, so as not to garble permalinks with572 // Add the (escaped) URL after everything else has been sanitized, so as not to garble permalinks with 570 573 // multi-byte characters in them. 571 574 $status = str_replace( '%permalink%', esc_url_raw( get_permalink( $post_id ) ), $status ); … … 631 634 $tag_name = $tag->name; 632 635 633 if ( preg_match( '/(\s|- )+/', $tag_name ) ) {636 if ( preg_match( '/(\s|-|\.)+/', $tag_name ) ) { 634 637 // Try to "CamelCase" multi-word tags. 635 $tag_name = preg_replace( '~(\s|- )+~', ' ', $tag_name );638 $tag_name = preg_replace( '~(\s|-|\.)+~', ' ', $tag_name ); 636 639 $tag_name = explode( ' ', $tag_name ); 637 640 $tag_name = implode( '', array_map( 'ucfirst', $tag_name ) ); … … 661 664 $cat_name = $cats[0]->cat_name; 662 665 663 if ( preg_match( '/(\s|- )+/', $cat_name ) ) {666 if ( preg_match( '/(\s|-|\.)+/', $cat_name ) ) { 664 667 // Try to "CamelCase" multi-word categories. 665 $cat_name = preg_replace( '~(\s|- )+~', ' ', $cat_name );668 $cat_name = preg_replace( '~(\s|-|\.)+~', ' ', $cat_name ); 666 669 $cat_name = explode( ' ', $cat_name ); 667 670 $cat_name = implode( '', array_map( 'ucfirst', $cat_name ) ); -
share-on-mastodon/tags/0.20.1/includes/class-share-on-mastodon.php
r3378001 r3451039 10 10 */ 11 11 class Share_On_Mastodon { 12 const PLUGIN_VERSION = '0.20. 0';12 const PLUGIN_VERSION = '0.20.1'; 13 13 const DB_VERSION = '2'; 14 14 -
share-on-mastodon/tags/0.20.1/readme.txt
r3378001 r3451039 1 1 === Share on Mastodon === 2 2 Contributors: janboddez 3 Tags: mastodon, s ocial, fediverse, syndication, posse4 Tested up to: 6. 85 Stable tag: 0.20. 03 Tags: mastodon, syndication, fediverse, posse, adopt-me 4 Tested up to: 6.9 5 Stable tag: 0.20.1 6 6 License: GNU General Public License v3.0 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 29 29 30 30 == Changelog == 31 = 0.20.1 = 32 Fix post screen `%category%` template tag. 33 31 34 = 0.20.0 = 32 35 Support for PKCE. -
share-on-mastodon/tags/0.20.1/share-on-mastodon.php
r3378001 r3451039 9 9 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 10 * Text Domain: share-on-mastodon 11 * Version: 0.20. 011 * Version: 0.20.1 12 12 * Requires at least: 5.9 13 13 * Requires PHP: 7.2 -
share-on-mastodon/trunk/includes/class-post-handler.php
r3378001 r3451039 59 59 // Sanitize custom status, if any. 60 60 if ( isset( $_POST['share_on_mastodon_status'] ) ) { 61 $status = sanitize_textarea_field( wp_unslash( $_POST['share_on_mastodon_status'] ) ); 62 $status = preg_replace( '~\R~u', "\r\n", $status ); 61 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 62 $status = str_replace( '%category%', '%yrogetac%', wp_unslash( $_POST['share_on_mastodon_status'] ) ); 63 $status = sanitize_textarea_field( $status ); // Sanitize after having replaced `%category%` to prevent WP from stripping out `%ca`. 64 $status = str_replace( '%yrogetac%', '%category%', $status ); // Undo what we did before. 65 $status = preg_replace( '~\R~u', "\r\n", $status ); // Normalize line endings. 63 66 } 64 67 … … 80 83 81 84 if ( ! empty( $content_warning ) && '' !== preg_replace( '~\s~', '', $content_warning ) ) { 82 // Save only if `$content_warning` is non-empty and.85 // Save only if `$content_warning` is non-empty. 83 86 update_post_meta( $post->ID, '_share_on_mastodon_cw', $content_warning ); 84 87 } else { … … 567 570 $status = sanitize_textarea_field( $status ); // Strips HTML and whatnot. 568 571 569 // Add the (escaped) URL after theeverything else has been sanitized, so as not to garble permalinks with572 // Add the (escaped) URL after everything else has been sanitized, so as not to garble permalinks with 570 573 // multi-byte characters in them. 571 574 $status = str_replace( '%permalink%', esc_url_raw( get_permalink( $post_id ) ), $status ); … … 631 634 $tag_name = $tag->name; 632 635 633 if ( preg_match( '/(\s|- )+/', $tag_name ) ) {636 if ( preg_match( '/(\s|-|\.)+/', $tag_name ) ) { 634 637 // Try to "CamelCase" multi-word tags. 635 $tag_name = preg_replace( '~(\s|- )+~', ' ', $tag_name );638 $tag_name = preg_replace( '~(\s|-|\.)+~', ' ', $tag_name ); 636 639 $tag_name = explode( ' ', $tag_name ); 637 640 $tag_name = implode( '', array_map( 'ucfirst', $tag_name ) ); … … 661 664 $cat_name = $cats[0]->cat_name; 662 665 663 if ( preg_match( '/(\s|- )+/', $cat_name ) ) {666 if ( preg_match( '/(\s|-|\.)+/', $cat_name ) ) { 664 667 // Try to "CamelCase" multi-word categories. 665 $cat_name = preg_replace( '~(\s|- )+~', ' ', $cat_name );668 $cat_name = preg_replace( '~(\s|-|\.)+~', ' ', $cat_name ); 666 669 $cat_name = explode( ' ', $cat_name ); 667 670 $cat_name = implode( '', array_map( 'ucfirst', $cat_name ) ); -
share-on-mastodon/trunk/includes/class-share-on-mastodon.php
r3378001 r3451039 10 10 */ 11 11 class Share_On_Mastodon { 12 const PLUGIN_VERSION = '0.20. 0';12 const PLUGIN_VERSION = '0.20.1'; 13 13 const DB_VERSION = '2'; 14 14 -
share-on-mastodon/trunk/readme.txt
r3378001 r3451039 1 1 === Share on Mastodon === 2 2 Contributors: janboddez 3 Tags: mastodon, s ocial, fediverse, syndication, posse4 Tested up to: 6. 85 Stable tag: 0.20. 03 Tags: mastodon, syndication, fediverse, posse, adopt-me 4 Tested up to: 6.9 5 Stable tag: 0.20.1 6 6 License: GNU General Public License v3.0 7 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 29 29 30 30 == Changelog == 31 = 0.20.1 = 32 Fix post screen `%category%` template tag. 33 31 34 = 0.20.0 = 32 35 Support for PKCE. -
share-on-mastodon/trunk/share-on-mastodon.php
r3378001 r3451039 9 9 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 10 * Text Domain: share-on-mastodon 11 * Version: 0.20. 011 * Version: 0.20.1 12 12 * Requires at least: 5.9 13 13 * Requires PHP: 7.2
Note: See TracChangeset
for help on using the changeset viewer.