Plugin Directory

Changeset 1073101


Ignore:
Timestamp:
01/22/2015 02:18:21 AM (11 years ago)
Author:
Developdaly
Message:

Fixes XSS vulnerability reported at https://wordpress.org/support/topic/xss-exploit-1

Location:
email/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • email/trunk/README.md

    r751115 r1073101  
    1515* new post
    1616* updated post
     17* deleted post
    1718* (more coming soon)
    1819
  • email/trunk/admin.php

    r751406 r1073101  
    157157
    158158                    <tr valign="top">
    159                         <th scope="row"><label for="<?php echo $email_type; ?>">Post Type</label></th>
    160                         <td>
    161                             <select id="<?php echo $email_type; ?>" name="<?php echo $email_type; ?>" class="chosen-select" multiple="multiple" data-placeholder="Choose post types..." style="width: 50%">
     159                        <th scope="row"><label for="<?php echo esc_attr( $email_type ); ?>">Post Type</label></th>
     160                        <td>
     161                            <select id="<?php echo esc_attr( $email_type ); ?>" name="<?php echo esc_attr( $email_type ); ?>" class="chosen-select" multiple="multiple" data-placeholder="Choose post types..." style="width: 50%">
    162162                                <?php foreach( $types as $key => $value ) {
    163                                     echo '<option val="'. $key .'">'. $value .'</option>';
     163                                    echo '<option val="'. esc_attr( $key ) .'">'. esc_html( $value ) .'</option>';
    164164                                }; ?>
    165165                            </select>
     
    168168
    169169                    <tr valign="top">
    170                         <th scope="row"><label for="<?php echo $email_action; ?>">Action</label></th>
    171                         <td>
    172                             <select id="<?php echo $email_action; ?>" name="<?php echo $email_action; ?>" class="chosen-select" multiple="multiple" data-placeholder="Choose actions..." style="width: 50%">
     170                        <th scope="row"><label for="<?php echo esc_attr( $email_action ); ?>">Action</label></th>
     171                        <td>
     172                            <select id="<?php echo esc_attr( $email_action ); ?>" name="<?php echo esc_attr( $email_action ); ?>" class="chosen-select" multiple="multiple" data-placeholder="Choose actions..." style="width: 50%">
    173173                                <?php foreach( $actions as $key => $value ) {
    174                                     echo '<option val="'. $key .'">'. $value .'</option>';
     174                                    echo '<option val="'. esc_attr( $key ) .'">'. esc_html( $value ) .'</option>';
    175175                                }; ?>
    176176                            </select>
     
    179179
    180180                    <tr valign="top">
    181                         <th scope="row"><label for="<?php echo $email_fromPname; ?>">From</label></th>
    182                         <td>
    183                             <input type="text" id="<?php echo $email_from_name; ?>" name="<?php echo $email_from_name; ?>" style="width: 25%" value="<?php echo get_bloginfo( 'site_name' ); ?>" placeholder="The name in the From field">
    184                             <input type="text" id="<?php echo $email_from; ?>" name="<?php echo $email_from; ?>" style="width: 25%" value="<?php echo $current_user->user_email; ?>" placeholder="The email address to send from">
    185                         </td>
    186                     </tr>
    187 
    188                     <tr valign="top">
    189                         <th scope="row"><label for="<?php echo $email_to_role; ?>">To</label></th>
    190                         <td>
    191                             <select id="<?php echo $email_to_role; ?>" name="<?php echo $email_to_role; ?>" class="chosen-select select-role" data-placeholder="Choose a role (optional)" style="width: 25%">
     181                        <th scope="row"><label for="<?php echo esc_attr( $email_fromPname ); ?>">From</label></th>
     182                        <td>this should be secure
     183                            <input type="text" id="<?php echo esc_attr( $email_from_name ); ?>" name="<?php echo esc_attr( $email_from_name ); ?>" style="width: 25%" value="<?php echo esc_attr( get_bloginfo( 'site_name' ) ); ?>" placeholder="The name in the From field">
     184                            <input type="text" id="<?php echo esc_attr( $email_from ); ?>" name="<?php echo esc_attr( $email_from ); ?>" style="width: 25%" value="<?php echo esc_attr( $current_user->user_email ); ?>" placeholder="The email address to send from">
     185                        </td>
     186                    </tr>
     187
     188                    <tr valign="top">
     189                        <th scope="row"><label for="<?php echo esc_attr( $email_to_role ); ?>">To</label></th>
     190                        <td>
     191                            <select id="<?php echo esc_attr( $email_to_role ); ?>" name="<?php echo esc_attr( $email_to_role ); ?>" class="chosen-select select-role" data-placeholder="Choose a role (optional)" style="width: 25%">
    192192                                <option></option>
    193193                                <?php wp_dropdown_roles(); ?>
    194194                            </select>
    195                             <input type="text" id="<?php echo $email_to; ?>" name="<?php echo $email_to; ?>" style="width: 70%" placeholder="Additional email addresses">
    196                         </td>
    197                     </tr>
    198 
    199                     <tr valign="top">
    200                         <th scope="row"><label for="<?php echo $email_cc_role; ?>">CC</label></th>
    201                         <td>
    202                             <select id="<?php echo $email_cc_role; ?>" name="<?php echo $email_cc_role; ?>" class="chosen-select select-role" data-placeholder="Choose a role (optional)" style="width: 25%">
     195                            <input type="text" id="<?php echo esc_attr( $email_to ); ?>" name="<?php echo esc_attr( $email_to ); ?>" style="width: 70%" placeholder="Additional email addresses">
     196                        </td>
     197                    </tr>
     198
     199                    <tr valign="top">
     200                        <th scope="row"><label for="<?php echo esc_attr( $email_cc_role ); ?>">CC</label></th>
     201                        <td>
     202                            <select id="<?php echo esc_attr( $email_cc_role ); ?>" name="<?php echo esc_attr( $email_cc_role ); ?>" class="chosen-select select-role" data-placeholder="Choose a role (optional)" style="width: 25%">
    203203                                <option></option>
    204204                                <?php wp_dropdown_roles(); ?>
    205205                            </select>
    206                             <input type="text" id="<?php echo $email_cc; ?>" name="<?php echo $email_cc; ?>" style="width: 70%" placeholder="Additional email addresses">
    207                         </td>
    208                     </tr>
    209 
    210                     <tr valign="top">
    211                         <th scope="row"><label for="<?php echo $email_bcc_role; ?>">BCC</label></th>
    212                         <td>
    213                             <select id="<?php echo $email_bcc_role; ?>" name="<?php echo $email_bcc_role; ?>" class="chosen-select select-role" data-placeholder="Choose a role (optional)" style="width: 25%">
     206                            <input type="text" id="<?php echo esc_attr( $email_cc ); ?>" name="<?php echo esc_attr( $email_cc ); ?>" style="width: 70%" placeholder="Additional email addresses">
     207                        </td>
     208                    </tr>
     209
     210                    <tr valign="top">
     211                        <th scope="row"><label for="<?php echo esc_attr( $email_bcc_role ); ?>">BCC</label></th>
     212                        <td>
     213                            <select id="<?php echo esc_attr( $email_bcc_role ); ?>" name="<?php echo esc_attr( $email_bcc_role ); ?>" class="chosen-select select-role" data-placeholder="Choose a role (optional)" style="width: 25%">
    214214                                <option></option>
    215215                                <?php wp_dropdown_roles(); ?>
    216216                            </select>
    217                             <input type="text" id="<?php echo $email_bcc; ?>" name="<?php echo $email_bcc; ?>" style="width: 70%" placeholder="Additional email addresses">
    218                         </td>
    219                     </tr>
    220 
    221                     <tr valign="top">
    222                         <th scope="row"><label for="<?php echo $email_subject; ?>">Subject</label></th>
    223                         <td>
    224                             <input type="text" name="<?php echo $email_subject; ?>" style="width: 50%" value="[[site_name]] [post_title] [action]"> Example: "[My Site] Hello World! updated"
    225                         </td>
    226                     </tr>
    227 
    228                     <tr valign="top">
    229                         <th scope="row"><label for="<?php echo $email_message; ?>">Message</label></th>
     217                            <input type="text" id="<?php echo esc_attr( $email_bcc ); ?>" name="<?php echo esc_attr( $email_bcc ); ?>" style="width: 70%" placeholder="Additional email addresses">
     218                        </td>
     219                    </tr>
     220
     221                    <tr valign="top">
     222                        <th scope="row"><label for="<?php echo esc_attr( $email_subject ); ?>">Subject</label></th>
     223                        <td>
     224                            <input type="text" name="<?php echo esc_attr( $email_subject ); ?>" style="width: 50%" value="[[site_name]] [post_title] [action]"> Example: "[My Site] Hello World! updated"
     225                        </td>
     226                    </tr>
     227
     228                    <tr valign="top">
     229                        <th scope="row"><label for="<?php echo esc_attr( $email_message ); ?>">Message</label></th>
    230230                        <td>
    231231
     
    239239                        <th scope="row"></th>
    240240                        <td>
    241                             <input type="hidden" name="<?php echo $email_hidden; ?>" value="Y">
    242                             <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Setup Email') ?>" />
     241                            <input type="hidden" name="<?php echo esc_attr( $email_hidden ); ?>" value="Y">
     242                            <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Setup Email' ) ?>" />
    243243                        </td>
    244244                    </tr>
     
    520520        }
    521521
    522         $success[] = 'Edit <a href="'. get_edit_post_link( $post_id ) .'">'. get_the_title( $post_id ) .'</a>';
    523 
    524522        if( !empty( $post_id ) ) {
    525523            $output = '<div class="updated">';
     
    527525                $output .= '<ul>';
    528526                foreach( $success as $item ) {
    529                     $output .= '<li>'. $item .'</li>';
     527                    $output .= '<li>'. esc_html( $item ) .'</li>';
    530528                }
     529                $output .= 'Edit <a href="'. get_edit_post_link( $post_id ) .'">'. get_the_title( $post_id ) .'</a>';
    531530                $output .= '</ul>';
    532531            }
  • email/trunk/email.php

    r751406 r1073101  
    44 * Description: Email users with custom templates when certain actions happen, such as new posts, updated custom post types, deleted users.
    55 * Author: developdaly
    6  * Version: 1.1
     6 * Version: 1.1.1
    77 * Author URI: http://developdaly.com/
    88 * Text Domain: email
  • email/trunk/readme.txt

    r751406 r1073101  
    44Requires at least: 3.5.2
    55Tested up to: 3.6
    6 Stable tag: 1.1
     6Stable tag: 1.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.