Changeset 11381 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php
- Timestamp:
- 12/16/2021 04:21:13 AM (3 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
r10796 r11381 18 18 } 19 19 20 $readme_url = $_REQUEST['readme'] ?? ''; 21 $readme_contents = $_POST['readme_contents'] ?? ''; 22 $readme_contents = base64_decode( wp_unslash( $readme_contents ) ); 20 $readme_url = ''; 21 $readme_contents = ''; 22 if ( ! empty( $_REQUEST['readme'] ) && is_string( $_REQUEST['readme'] ) ) { 23 $readme_url = $_REQUEST['readme']; 24 } 25 if ( ! empty( $_POST['readme_contents'] ) && is_string( $_POST['readme_contents'] ) ) { 26 $readme_contents = base64_decode( wp_unslash( $_POST['readme_contents'] ) ); 27 } 23 28 ?> 24 29 … … 59 64 */ 60 65 protected static function validate_readme() { 61 if ( ! empty( $_REQUEST['readme'] ) ) {66 if ( ! empty( $_REQUEST['readme'] ) && is_string( $_REQUEST['readme'] ) ) { 62 67 $errors = Validator::instance()->validate_url( wp_unslash( $_REQUEST['readme'] ) ); 63 68 64 } elseif ( ! empty( $_POST['readme_contents'] ) ) {69 } elseif ( ! empty( $_POST['readme_contents'] ) && is_string( $_POST['readme_contents'] ) ) { 65 70 $errors = Validator::instance()->validate_content( base64_decode( wp_unslash( $_REQUEST['readme_contents'] ) ) ); 66 71
Note: See TracChangeset
for help on using the changeset viewer.