Making WordPress.org

Changeset 14818


Ignore:
Timestamp:
04/16/2026 02:49:11 AM (6 months ago)
Author:
dd32
Message:

Decodes plugin titles in email subjects and bodies

Props nimeshatxecurify.
Closes ​https://github.com/WordPress/wordpress.org/pull/606.
Fixes #8231.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-base.php

    r14413 r14818  
    164164
    165165        /**
     166         * Return the plugin's title with HTML entities decoded for plain-text use (e.g., email subjects).
     167         */
     168        protected function plugin_title() {
     169                return html_entity_decode( $this->plugin->post_title, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
     170        }
     171
     172        /**
    166173         * A simple way to convert a WP_User object to a displayable username.
    167174         * This shouldn't be needed, but unfortunately often is on WordPress.org.
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-committer-added.php

    r14718 r14818  
    2323                        /* translators: 1: Plugin Name */
    2424                        __( 'New committer added to %s', 'wporg-plugins' ),
    25                         $this->plugin->post_title
     25                        $this->plugin_title()
    2626                );
    2727        }
    … …  
    5353                        $this->user_text( $this->user ),
    5454                        $this->user_text( $this->args['committer'] ),
    55                         $this->plugin->post_title,
     55                        $this->plugin_title(),
    5656                        $this->user_text( $this->who ),
    5757                        $committer_list,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-generic-to-committers.php

    r10727 r14818  
    4949        private function replace_placeholders( $text ) {
    5050                $items = [
    51                         '###PLUGIN###'            => $this->plugin->post_title,
     51                        '###PLUGIN###'            => $this->plugin_title(),
    5252                        '###URL###'               => get_permalink( $this->plugin ),
    5353                        '###SLUG###'              => $this->plugin->post_name,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-approved.php

    r14073 r14818  
    1111                        /* translators: 1: Plugin Name */
    1212                        __( '%s has been approved!', 'wporg-plugins' ),
    13                         $this->plugin->post_title
     13                        $this->plugin_title()
    1414                );
    1515        }
    … …  
    6767                return sprintf(
    6868                        $email_text,
    69                         $this->plugin->post_title,
     69                        $this->plugin_title(),
    7070                        $this->user->user_login,
    7171                        $this->plugin->post_name,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-rejected.php

    r14746 r14818  
    1313                        /* translators: 1: Plugin Name */
    1414                        __( '%s has been rejected', 'wporg-plugins' ),
    15                         $this->plugin->post_title
     15                        $this->plugin_title()
    1616                );
    1717        }
    … …  
    2121                        // Should be first, to allow placeholders in the rejection reasons too.
    2222                        '###REASON###'          => $this->get_rejection_reason(),
    23                         '###NAME###'            => $this->plugin->post_title,
     23                        '###NAME###'            => $this->plugin_title(),
    2424                        '###SLUG###'            => ( $this->args['slug'] ?? '' ) ?: $this->plugin->post_name,
    2525                        '###SUBMISSION_DATE###' => $this->args['submission_date'],
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-submission.php

    r13131 r14818  
    1010                        /* translators: 1: Plugin Name */
    1111                        __( 'Successful Plugin Submission - %s', 'wporg-plugins' ),
    12                         $this->plugin->post_title
     12                        $this->plugin_title()
    1313                );
    1414        }
    … …  
    2020
    2121                $placeholders = [
    22                         '###NAME###' => $this->plugin->post_title,
     22                        '###NAME###' => $this->plugin_title(),
    2323                        '###SLUG###' => $this->plugin->post_name,
    2424                ];
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-plugin-transferred.php

    r10125 r14818  
    1111                        /* translators: 1: Plugin Name */
    1212                        __( '%s has been transferred', 'wporg-plugins' ),
    13                         $this->plugin->post_title
     13                        $this->plugin_title()
    1414                );
    1515        }
    … …  
    2525                        $this->user_text( wp_get_current_user() ),
    2626                        gmdate( 'Y-m-d H:i:s \G\M\T' ),
    27                         $this->plugin->post_title,
     27                        $this->plugin_title(),
    2828                        $this->user_text( $this->args['owner'] ) . ' (' . $this->args['owner']->user_login . ')',
    2929                        PLUGIN_TEAM_EMAIL
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-release-confirmation-enabled.php

    r12178 r14818  
    1111                        /* translators: 1: Plugin Name */
    1212                        __( 'Release confirmation now required for %s', 'wporg-plugins' ),
    13                         $this->plugin->post_title
     13                        $this->plugin_title()
    1414                );
    1515        }
    … …  
    3232                        $this->user_text( $this->user ),
    3333                        $this->user_text( $this->who ),
    34                         $this->plugin->post_title,
     34                        $this->plugin_title(),
    3535                        get_permalink( $this->plugin ),
    3636                        $this->plugin->post_name,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-release-confirmation.php

    r13889 r14818  
    1616                        /* translators: 1: Plugin Name */
    1717                        __( 'Pending release for %s', 'wporg-plugins' ),
    18                         $this->plugin->post_title
     18                        $this->plugin_title()
    1919                );
    2020        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-support-rep-added.php

    r10127 r14818  
    1111                        /* translators: 1: Plugin Name */
    1212                        __( 'New support rep added to %s', 'wporg-plugins' ),
    13                         $this->plugin->post_title
     13                        $this->plugin_title()
    1414                );
    1515        }
    … …  
    4141                        $this->user_text( $this->user ),
    4242                        $this->user_text( $this->args['rep'] ),
    43                         $this->plugin->post_title,
     43                        $this->plugin_title(),
    4444                        $this->user_text( $this->who ),
    4545                        $rep_list,
Note: See TracChangeset for help on using the changeset viewer.