Ticket #39304: 39304.1.diff
File 39304.1.diff, 1.7 KB (added by , 7 years ago) |
---|
-
src/wp-includes/media.php
3681 3681 if ( 'gallery' === $shortcode[2] ) { 3682 3682 $srcs = array(); 3683 3683 3684 $shortcode_attrs = shortcode_parse_atts( $shortcode[3] ); 3685 if ( ! is_array( $shortcode_attrs ) ) { 3686 $shortcode_attrs = array(); 3687 } 3688 3689 // force-specify the post id of the gallery we want to view. 3690 if ( empty( $shortcode_attrs['id'] ) ) { 3691 $shortcode[3] .= ' id="' . $post->ID . '"'; 3692 } 3693 3684 3694 $gallery = do_shortcode_tag( $shortcode ); 3685 3695 if ( $html ) { 3686 3696 $galleries[] = $gallery; … … 3691 3701 $srcs[] = $s[2]; 3692 3702 } 3693 3703 3694 $data = shortcode_parse_atts( $shortcode[3] ); 3695 $data['src'] = array_values( array_unique( $srcs ) ); 3696 $galleries[] = $data; 3704 $shortcode_attrs['src'] = array_values( array_unique( $srcs ) ); 3705 $galleries[] = $shortcode_attrs; 3697 3706 } 3698 3707 } 3699 3708 } -
src/wp-includes/vars.php
28 28 preg_match('#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches); 29 29 else 30 30 preg_match('#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches); 31 $pagenow = $self_matches[1]; 31 array_key_exists( 1, $self_matches ) ? $pagenow = $self_matches[1] : ''; 32 // $pagenow = $self_matches[1]; 32 33 $pagenow = trim($pagenow, '/'); 33 34 $pagenow = preg_replace('#\?.*?$#', '', $pagenow); 34 35 if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {