WordPress.org

Making WordPress.org


Ignore:
Timestamp:
02/15/2018 04:27:17 PM (19 months ago)
Author:
ocean90
Message:

Plugin Directory: Remove extra whitespace in textarea for readme validation.

Fixes #3458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php

    r6479 r6647  
    1818                self::validate_readme();
    1919            }
     20
     21            $readme_url      = $_POST['readme_url'] ?? '';
     22            $readme_contents = $_POST['readme_contents'] ?? '';
     23            $readme_contents = base64_decode( wp_unslash( $readme_contents ) );
    2024            ?>
    2125
    2226            <form method="post" action="">
    2327                <p>
    24                     <input type="text" name="readme_url" size="70" placeholder="https://" value="
    25                     <?php
    26                     if ( isset( $_POST['readme_url'] ) ) {
    27                         echo esc_attr( $_POST['readme_url'] );
    28                     }
    29                     ?>
    30                     " />
     28                    <input type="text" name="readme_url" size="70" placeholder="https://" value="<?php echo esc_attr( $readme_url ); ?>" />
    3129                    <input type="submit" class="button button-secondary" value="<?php esc_attr_e( 'Validate!', 'wporg-plugins' ); ?>" />
    3230                </p>
     
    3432
    3533            <p><?php _e( '... or paste your <code>readme.txt</code> here:', 'wporg-plugins' ); ?></p>
    36                 <textarea rows="20" cols="100" name="readme_visible" placeholder="=== Plugin Name ===">
    37                     <?php
    38                     if ( isset( $_POST['readme_contents'] ) ) {
    39                         echo esc_textarea( base64_decode( wp_unslash( $_POST['readme_contents'] ) ) );
    40                     }
    41                     ?>
    42                 </textarea>
     34                <textarea rows="20" cols="100" name="readme_visible" placeholder="=== Plugin Name ==="><?php echo esc_textarea( $readme_contents ); ?></textarea>
    4335                <form id="readme-data" method="post" action="">
    44                     <textarea class="screen-reader-text" rows="20" cols="100" name="readme_contents">
    45                         <?php
    46                         if ( isset( $_POST['readme_contents'] ) ) {
    47                             echo esc_textarea( base64_decode( wp_unslash( $_POST['readme_contents'] ) ) );
    48                         }
    49                         ?>
    50                     </textarea>
     36                    <textarea class="screen-reader-text" rows="20" cols="100" name="readme_contents"><?php echo esc_textarea( $readme_contents ); ?></textarea>
    5137                <p><input type="submit" class="button button-secondary" value="<?php esc_attr_e( 'Validate!', 'wporg-plugins' ); ?>" /></p>
    5238            </form>
Note: See TracChangeset for help on using the changeset viewer.