Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/24/2016 02:34:37 PM (10 years ago)
Author:
boonebgorges
Message:

Better hash building for activation keys, password reset keys, and filenames.

There is no need to use user-facing info for these hashes.

Props DJPaul, vortfu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-attachment-cover-image.php

    r10417 r10800  
    209209        }
    210210
    211         $info    = pathinfo( $file );
    212         $dir     = $info['dirname'];
    213         $ext     = strtolower( $info['extension'] );
    214         $name    = wp_hash( $file . time() ) . '-bp-cover-image';
    215 
    216         return trailingslashit( $dir ) . "{$name}.{$ext}";
     211        $info = pathinfo( $file );
     212        $ext  = strtolower( $info['extension'] );
     213        $name = wp_unique_filename( $info['dirname'], uniqid() . "-bp-cover-image.$ext" );
     214
     215        return trailingslashit( $info['dirname'] ) . $name;
    217216    }
    218217
Note: See TracChangeset for help on using the changeset viewer.