Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/26/2019 10:47:56 AM (5 years ago)
Author:
imath
Message:

Avatars: make sure to respect the "force_default" argument

If "force_default" is true:

  1. do not attempt to scan for uploaded images,
  2. ensure that the d parameter is set to default as passed from get_avatar(),
  3. Do not do the default_avatar override.

Props boonebgorges, netweblogic

Fixes #8026

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-avatars.php

    r12338 r12417  
    477477
    478478    // Check for directory.
    479     if ( file_exists( $avatar_folder_dir ) ) {
     479    if ( ! $params['force_default'] && file_exists( $avatar_folder_dir ) ) {
    480480
    481481        // Open directory.
     
    638638        if ( ! empty( $params['force_default'] ) ) {
    639639            $url_args['f'] = 'y';
     640            $url_args['d'] = $params['default'];
    640641        }
    641642        if ( ! empty( $params['rating'] ) ) {
     
    654655
    655656        // Only set default image if 'Gravatar Logo' is not requested.
    656         if ( 'gravatar_default' !== $default_grav ) {
     657        if ( ! $params['force_default'] && 'gravatar_default' !== $default_grav ) {
    657658            $url_args['d'] = $default_grav;
    658659        }
Note: See TracChangeset for help on using the changeset viewer.