Changeset 6479 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php
- Timestamp:
- 01/30/2018 11:30:30 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php
r6287 r6479 34 34 35 35 <p><?php _e( '... or paste your <code>readme.txt</code> here:', 'wporg-plugins' ); ?></p> 36 <form method="post" action=""> 37 <textarea rows="20" cols="100" name="readme_contents" placeholder="=== Plugin Name ==="> 36 <textarea rows="20" cols="100" name="readme_visible" placeholder="=== Plugin Name ==="> 38 37 <?php 39 38 if ( isset( $_POST['readme_contents'] ) ) { 40 echo esc_textarea( wp_unslash( $_POST['readme_contents']) );39 echo esc_textarea( base64_decode( wp_unslash( $_POST['readme_contents'] ) ) ); 41 40 } 42 41 ?> 43 42 </textarea> 43 <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> 44 51 <p><input type="submit" class="button button-secondary" value="<?php esc_attr_e( 'Validate!', 'wporg-plugins' ); ?>" /></p> 45 52 </form> 53 <script> 54 document.getElementById( 'readme-data' ).addEventListener( 'submit', function() { 55 var readmeInputs = document.getElementsByTagName( 'textarea' ); 56 57 readmeInputs[1].value = window.btoa( readmeInputs[0].value ); 58 59 return true; 60 } ); 61 </script> 46 62 </div> 47 63 <?php … … 56 72 57 73 } elseif ( ! empty( $_POST['readme_contents'] ) ) { 58 $errors = Validator::instance()->validate_content( wp_unslash( $_REQUEST['readme_contents']) );74 $errors = Validator::instance()->validate_content( base64_decode( wp_unslash( $_REQUEST['readme_contents'] ) ) ); 59 75 60 76 } else {
Note: See TracChangeset
for help on using the changeset viewer.