Plugin Directory

Changeset 3451039


Ignore:
Timestamp:
01/31/2026 02:49:52 PM (2 months ago)
Author:
janboddez
Message:

Update to version 0.20.1 from GitHub

Location:
share-on-mastodon
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • share-on-mastodon/tags/0.20.1/includes/class-post-handler.php

    r3378001 r3451039  
    5959        // Sanitize custom status, if any.
    6060        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.
    6366        }
    6467
     
    8083
    8184        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.
    8386            update_post_meta( $post->ID, '_share_on_mastodon_cw', $content_warning );
    8487        } else {
     
    567570        $status = sanitize_textarea_field( $status ); // Strips HTML and whatnot.
    568571
    569         // Add the (escaped) URL after the everything else has been sanitized, so as not to garble permalinks with
     572        // Add the (escaped) URL after everything else has been sanitized, so as not to garble permalinks with
    570573        // multi-byte characters in them.
    571574        $status = str_replace( '%permalink%', esc_url_raw( get_permalink( $post_id ) ), $status );
     
    631634                $tag_name = $tag->name;
    632635
    633                 if ( preg_match( '/(\s|-)+/', $tag_name ) ) {
     636                if ( preg_match( '/(\s|-|\.)+/', $tag_name ) ) {
    634637                    // Try to "CamelCase" multi-word tags.
    635                     $tag_name = preg_replace( '~(\s|-)+~', ' ', $tag_name );
     638                    $tag_name = preg_replace( '~(\s|-|\.)+~', ' ', $tag_name );
    636639                    $tag_name = explode( ' ', $tag_name );
    637640                    $tag_name = implode( '', array_map( 'ucfirst', $tag_name ) );
     
    661664        $cat_name = $cats[0]->cat_name;
    662665
    663         if ( preg_match( '/(\s|-)+/', $cat_name ) ) {
     666        if ( preg_match( '/(\s|-|\.)+/', $cat_name ) ) {
    664667            // Try to "CamelCase" multi-word categories.
    665             $cat_name = preg_replace( '~(\s|-)+~', ' ', $cat_name );
     668            $cat_name = preg_replace( '~(\s|-|\.)+~', ' ', $cat_name );
    666669            $cat_name = explode( ' ', $cat_name );
    667670            $cat_name = implode( '', array_map( 'ucfirst', $cat_name ) );
  • share-on-mastodon/tags/0.20.1/includes/class-share-on-mastodon.php

    r3378001 r3451039  
    1010 */
    1111class Share_On_Mastodon {
    12     const PLUGIN_VERSION = '0.20.0';
     12    const PLUGIN_VERSION = '0.20.1';
    1313    const DB_VERSION     = '2';
    1414
  • share-on-mastodon/tags/0.20.1/readme.txt

    r3378001 r3451039  
    11=== Share on Mastodon ===
    22Contributors: janboddez
    3 Tags: mastodon, social, fediverse, syndication, posse
    4 Tested up to: 6.8
    5 Stable tag: 0.20.0
     3Tags: mastodon, syndication, fediverse, posse, adopt-me
     4Tested up to: 6.9
     5Stable tag: 0.20.1
    66License: GNU General Public License v3.0
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2929
    3030== Changelog ==
     31= 0.20.1 =
     32Fix post screen `%category%` template tag.
     33
    3134= 0.20.0 =
    3235Support for PKCE.
  • share-on-mastodon/tags/0.20.1/share-on-mastodon.php

    r3378001 r3451039  
    99 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
    1010 * Text Domain:       share-on-mastodon
    11  * Version:           0.20.0
     11 * Version:           0.20.1
    1212 * Requires at least: 5.9
    1313 * Requires PHP:      7.2
  • share-on-mastodon/trunk/includes/class-post-handler.php

    r3378001 r3451039  
    5959        // Sanitize custom status, if any.
    6060        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.
    6366        }
    6467
     
    8083
    8184        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.
    8386            update_post_meta( $post->ID, '_share_on_mastodon_cw', $content_warning );
    8487        } else {
     
    567570        $status = sanitize_textarea_field( $status ); // Strips HTML and whatnot.
    568571
    569         // Add the (escaped) URL after the everything else has been sanitized, so as not to garble permalinks with
     572        // Add the (escaped) URL after everything else has been sanitized, so as not to garble permalinks with
    570573        // multi-byte characters in them.
    571574        $status = str_replace( '%permalink%', esc_url_raw( get_permalink( $post_id ) ), $status );
     
    631634                $tag_name = $tag->name;
    632635
    633                 if ( preg_match( '/(\s|-)+/', $tag_name ) ) {
     636                if ( preg_match( '/(\s|-|\.)+/', $tag_name ) ) {
    634637                    // Try to "CamelCase" multi-word tags.
    635                     $tag_name = preg_replace( '~(\s|-)+~', ' ', $tag_name );
     638                    $tag_name = preg_replace( '~(\s|-|\.)+~', ' ', $tag_name );
    636639                    $tag_name = explode( ' ', $tag_name );
    637640                    $tag_name = implode( '', array_map( 'ucfirst', $tag_name ) );
     
    661664        $cat_name = $cats[0]->cat_name;
    662665
    663         if ( preg_match( '/(\s|-)+/', $cat_name ) ) {
     666        if ( preg_match( '/(\s|-|\.)+/', $cat_name ) ) {
    664667            // Try to "CamelCase" multi-word categories.
    665             $cat_name = preg_replace( '~(\s|-)+~', ' ', $cat_name );
     668            $cat_name = preg_replace( '~(\s|-|\.)+~', ' ', $cat_name );
    666669            $cat_name = explode( ' ', $cat_name );
    667670            $cat_name = implode( '', array_map( 'ucfirst', $cat_name ) );
  • share-on-mastodon/trunk/includes/class-share-on-mastodon.php

    r3378001 r3451039  
    1010 */
    1111class Share_On_Mastodon {
    12     const PLUGIN_VERSION = '0.20.0';
     12    const PLUGIN_VERSION = '0.20.1';
    1313    const DB_VERSION     = '2';
    1414
  • share-on-mastodon/trunk/readme.txt

    r3378001 r3451039  
    11=== Share on Mastodon ===
    22Contributors: janboddez
    3 Tags: mastodon, social, fediverse, syndication, posse
    4 Tested up to: 6.8
    5 Stable tag: 0.20.0
     3Tags: mastodon, syndication, fediverse, posse, adopt-me
     4Tested up to: 6.9
     5Stable tag: 0.20.1
    66License: GNU General Public License v3.0
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2929
    3030== Changelog ==
     31= 0.20.1 =
     32Fix post screen `%category%` template tag.
     33
    3134= 0.20.0 =
    3235Support for PKCE.
  • share-on-mastodon/trunk/share-on-mastodon.php

    r3378001 r3451039  
    99 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
    1010 * Text Domain:       share-on-mastodon
    11  * Version:           0.20.0
     11 * Version:           0.20.1
    1212 * Requires at least: 5.9
    1313 * Requires PHP:      7.2
Note: See TracChangeset for help on using the changeset viewer.