Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/19/2015 04:27:37 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Templates: Escape all gettext output in default template parts. See #1999.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/templates/default/bbpress/form-topic.php

    r5563 r5688  
    3939                    <?php
    4040                        if ( bbp_is_topic_edit() ) :
    41                             printf( __( 'Now Editing &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_topic_title() );
     41                            printf( esc_html__( 'Now Editing &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_topic_title() );
    4242                        else :
    4343                            ( bbp_is_single_forum() && bbp_get_forum_title() )
    44                                 ? printf( __( 'Create New Topic in &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() )
    45                                 : _e( 'Create New Topic', 'bbpress' );
     44                                ? printf( esc_html__( 'Create New Topic in &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() )
     45                                : esc_html_e( 'Create New Topic', 'bbpress' );
    4646                        endif;
    4747                    ?>
     
    5555                    <div class="bbp-template-notice">
    5656                        <ul>
    57                             <li><?php _e( 'This forum is marked as closed to new topics, however your posting capabilities still allow you to do so.', 'bbpress' ); ?></li>
     57                            <li><?php esc_html_e( 'This forum is marked as closed to new topics, however your posting capabilities still allow you to do so.', 'bbpress' ); ?></li>
    5858                        </ul>
    5959                    </div>
     
    6565                    <div class="bbp-template-notice">
    6666                        <ul>
    67                             <li><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></li>
     67                            <li><?php esc_html_e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></li>
    6868                        </ul>
    6969                    </div>
     
    8080
    8181                    <p>
    82                         <label for="bbp_topic_title"><?php printf( __( 'Topic Title (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
     82                        <label for="bbp_topic_title"><?php printf( esc_html__( 'Topic Title (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
    8383                        <input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" size="40" name="bbp_topic_title" maxlength="<?php bbp_title_max_length(); ?>" />
    8484                    </p>
     
    9595
    9696                        <p class="form-allowed-tags">
    97                             <label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
     97                            <label><?php printf( esc_html__( 'You may use these %s tags and attributes:', 'bbpress' ), '<abbr title="HyperText Markup Language">HTML</abbr>' ); ?></label><br />
    9898                            <code><?php bbp_allowed_tags(); ?></code>
    9999                        </p>
     
    106106
    107107                        <p>
    108                             <label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
     108                            <label for="bbp_topic_tags"><?php esc_html_e( 'Topic Tags:', 'bbpress' ); ?></label><br />
    109109                            <input type="text" value="<?php bbp_form_topic_tags(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> />
    110110                        </p>
     
    119119
    120120                        <p>
    121                             <label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
     121                            <label for="bbp_forum_id"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></label><br />
    122122                            <?php
    123123                                bbp_dropdown( array(
    124                                     'show_none' => __( '(No Forum)', 'bbpress' ),
     124                                    'show_none' => esc_html__( '(No Forum)', 'bbpress' ),
    125125                                    'selected'  => bbp_get_form_topic_forum()
    126126                                ) );
     
    138138                        <p>
    139139
    140                             <label for="bbp_stick_topic"><?php _e( 'Topic Type:', 'bbpress' ); ?></label><br />
     140                            <label for="bbp_stick_topic"><?php esc_html_e( 'Topic Type:', 'bbpress' ); ?></label><br />
    141141
    142142                            <?php bbp_form_topic_type_dropdown(); ?>
     
    150150                        <p>
    151151
    152                             <label for="bbp_topic_status"><?php _e( 'Topic Status:', 'bbpress' ); ?></label><br />
     152                            <label for="bbp_topic_status"><?php esc_html_e( 'Topic Status:', 'bbpress' ); ?></label><br />
    153153
    154154                            <?php bbp_form_topic_status_dropdown(); ?>
     
    169169                            <?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
    170170
    171                                 <label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
     171                                <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    172172
    173173                            <?php else : ?>
    174174
    175                                 <label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
     175                                <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    176176
    177177                            <?php endif; ?>
     
    189189                            <legend>
    190190                                <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> />
    191                                 <label for="bbp_log_topic_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
     191                                <label for="bbp_log_topic_edit"><?php esc_html_e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
    192192                            </legend>
    193193
    194194                            <div>
    195                                 <label for="bbp_topic_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
     195                                <label for="bbp_topic_edit_reason"><?php printf( esc_html__( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
    196196                                <input type="text" value="<?php bbp_form_topic_edit_reason(); ?>" size="40" name="bbp_topic_edit_reason" id="bbp_topic_edit_reason" />
    197197                            </div>
     
    208208                        <?php do_action( 'bbp_theme_before_topic_form_submit_button' ); ?>
    209209
    210                         <button type="submit" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
     210                        <button type="submit" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit"><?php esc_html_e( 'Submit', 'bbpress' ); ?></button>
    211211
    212212                        <?php do_action( 'bbp_theme_after_topic_form_submit_button' ); ?>
     
    232232        <div class="bbp-template-notice">
    233233            <ul>
    234                 <li><?php printf( __( 'The forum &#8216;%s&#8217; is closed to new topics and replies.', 'bbpress' ), bbp_get_forum_title() ); ?></li>
     234                <li><?php printf( esc_html__( 'The forum &#8216;%s&#8217; is closed to new topics and replies.', 'bbpress' ), bbp_get_forum_title() ); ?></li>
    235235            </ul>
    236236        </div>
     
    242242        <div class="bbp-template-notice">
    243243            <ul>
    244                 <li><?php is_user_logged_in() ? _e( 'You cannot create new topics.', 'bbpress' ) : _e( 'You must be logged in to create new topics.', 'bbpress' ); ?></li>
     244                <li><?php is_user_logged_in()
     245                    ? esc_html_e( 'You cannot create new topics.',               'bbpress' )
     246                    : esc_html_e( 'You must be logged in to create new topics.', 'bbpress' );
     247                ?></li>
    245248            </ul>
    246249        </div>
Note: See TracChangeset for help on using the changeset viewer.