Make WordPress Core

Changeset 50406


Ignore:
Timestamp:
02/22/2021 06:53:11 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Media: Explicitly declare the $pagenow global in wp_get_attachment_url().

This avoids an "Undefined index" PHP notice in the function when running the media test group separately.

Follow-up to [32342], [50156], [50164], [50393].

Props johnbillion.
Fixes #52606.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r50380 r50406  
    62786278 */
    62796279function wp_get_attachment_url( $attachment_id = 0 ) {
     6280    global $pagenow;
     6281
    62806282    $attachment_id = (int) $attachment_id;
    62816283
     
    63206322
    63216323    // On SSL front end, URLs should be HTTPS.
    6322     if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) {
     6324    if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) {
    63236325        $url = set_url_scheme( $url );
    63246326    }
Note: See TracChangeset for help on using the changeset viewer.