Make WordPress Core

Ticket #56110: 56110.patch

File 56110.patch, 5.3 KB (added by kartikpatel, 2 years ago)
  • wp-admin/options-permalink.php

    diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php
    index 87191625c7..468c2246b8 100644
    a b  
    1010require_once __DIR__ . '/admin.php';
    1111
    1212if ( ! current_user_can( 'manage_options' ) ) {
    13         wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
     13        wp_die( esc_html__( 'Sorry, you are not allowed to manage options for this site.' ) );
    1414}
    1515
    1616// Used in the HTML title tag.
    $structures = array( 
    244244        </tr>
    245245        <tr>
    246246                <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[1] ); ?>" <?php checked( $structures[1], $permalink_structure ); ?> /> <?php _e( 'Day and name' ); ?></label></th>
    247                 <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . gmdate( 'd' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
     247                <td><code><?php echo get_option( 'home' ) . esc_html( $blog_prefix ) . esc_html( $prefix ) . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . gmdate( 'd' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
    248248        </tr>
    249249        <tr>
    250250                <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[2] ); ?>" <?php checked( $structures[2], $permalink_structure ); ?> /> <?php _e( 'Month and name' ); ?></label></th>
    251                 <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
     251                <td><code><?php echo get_option( 'home' ) . esc_html( $blog_prefix ) . esc_html( $prefix ) . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
    252252        </tr>
    253253        <tr>
    254254                <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[3] ); ?>" <?php checked( $structures[3], $permalink_structure ); ?> /> <?php _e( 'Numeric' ); ?></label></th>
    255                 <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
     255                <td><code><?php echo get_option( 'home' ) . esc_html( $blog_prefix ) . esc_html( $prefix ) . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
    256256        </tr>
    257257        <tr>
    258258                <th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[4] ); ?>" <?php checked( $structures[4], $permalink_structure ); ?> /> <?php _e( 'Post name' ); ?></label></th>
    259                 <td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
     259                <td><code><?php echo get_option( 'home' ) . esc_html( $blog_prefix ) . esc_html( $prefix ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
    260260        </tr>
    261261        <tr>
    262262                <th scope="row">
    $structures = array( 
    265265                        </label>
    266266                </th>
    267267                <td>
    268                         <code><?php echo get_option( 'home' ) . $blog_prefix; ?></code>
     268                        <code><?php echo get_option( 'home' ) . esc_html( $blog_prefix ); ?></code>
    269269                        <input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr( $permalink_structure ); ?>" class="regular-text code" />
    270270                        <div class="available-structure-tags hide-if-no-js">
    271271                                <div id="custom_selection_updated" aria-live="assertive" class="screen-reader-text"></div>
    $structures = array( 
    338338<p>
    339339<?php
    340340/* translators: %s: Placeholder that must come at the start of the URL. */
    341 printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.' ), get_option( 'home' ) . $blog_prefix . $prefix );
     341printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.' ), get_option( 'home' ) . esc_html( $blog_prefix ) . esc_html( $prefix ) );
    342342?>
    343343</p>
    344344
    345345<table class="form-table" role="presentation">
    346346        <tr>
    347347                <th><label for="category_base"><?php /* translators: Prefix for category permalinks. */ _e( 'Category base' ); ?></label></th>
    348                 <td><?php echo $blog_prefix; ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
     348                <td><?php echo esc_html( $blog_prefix ); ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
    349349        </tr>
    350350        <tr>
    351351                <th><label for="tag_base"><?php _e( 'Tag base' ); ?></label></th>
    352                 <td><?php echo $blog_prefix; ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code" /></td>
     352                <td><?php echo esc_html( $blog_prefix ); ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code" /></td>
    353353        </tr>
    354354        <?php do_settings_fields( 'permalink', 'optional' ); ?>
    355355</table>