Make WordPress Core

Ticket #39304: 39304.1.diff

File 39304.1.diff, 1.7 KB (added by seanchayes, 7 years ago)

Correcting variable name

  • src/wp-includes/media.php

     
    36813681                        if ( 'gallery' === $shortcode[2] ) {
    36823682                                $srcs = array();
    36833683
     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
    36843694                                $gallery = do_shortcode_tag( $shortcode );
    36853695                                if ( $html ) {
    36863696                                        $galleries[] = $gallery;
     
    36913701                                                        $srcs[] = $s[2];
    36923702                                        }
    36933703
    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;
    36973706                                }
    36983707                        }
    36993708                }
  • src/wp-includes/vars.php

     
    2828                preg_match('#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
    2929        else
    3030                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];
    3233        $pagenow = trim($pagenow, '/');
    3334        $pagenow = preg_replace('#\?.*?$#', '', $pagenow);
    3435        if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {