Changeset 15148
- Timestamp:
- 09/04/2026 07:57:23 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/uploads.php
r15146 r15148 430 430 $rejection = __( 'Your submission must be an image in the JPEG format.', 'wporg-photos' ); 431 431 break; 432 case 'shortcode-in-text': 433 $rejection = __( 'The title, description, and caption cannot contain shortcodes. Please remove them and submit again.', 'wporg-photos' ); 434 break; 432 435 case 'file-too-large': 433 436 $rejection = sprintf( … … 499 502 } 500 503 501 $value = $sanitize( wp_unslash( $post_array[ $field ] ) ); 502 503 $post_array[ $field ] = wp_slash( strip_shortcodes( $value ) ); 504 $post_array[ $field ] = wp_slash( $sanitize( wp_unslash( $post_array[ $field ] ) ) ); 504 505 } 505 506 … … 701 702 if ( ! isset( $_POST['photo_license'] ) || ! $_POST['photo_license'] ) { 702 703 return 'checkbox_unchecked_license'; 704 } 705 706 foreach ( [ 'post_title', 'post_content', 'post_excerpt' ] as $field ) { 707 // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Read raw: sanitizing before the check would hide what it looks for. 708 $submitted = isset( $_POST[ $field ] ) ? wp_unslash( $_POST[ $field ] ) : ''; 709 710 // A field can arrive as an array, which Frontend Uploader drops before it builds the post. 711 if ( ! is_string( $submitted ) || '' === $submitted ) { 712 continue; 713 } 714 715 if ( preg_match( '/' . get_shortcode_regex() . '/', $submitted ) ) { 716 return 'shortcode-in-text'; 717 } 703 718 } 704 719
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)