WordPress.org

Make WordPress Core

Changeset 17998 for trunk/wp-app.php


Ignore:
Timestamp:
05/22/2011 11:23:57 PM (9 years ago)
Author:
ryan
Message:

Make sure ext passes through sanitize_file_name()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r17771 r17998  
    608608        $slug = '';
    609609        if ( isset( $_SERVER['HTTP_SLUG'] ) )
    610             $slug = sanitize_file_name( $_SERVER['HTTP_SLUG'] );
     610            $slug = $_SERVER['HTTP_SLUG'];
    611611        elseif ( isset( $_SERVER['HTTP_TITLE'] ) )
    612             $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] );
     612            $slug = $_SERVER['HTTP_TITLE'];
    613613        elseif ( empty( $slug ) ) // just make a random name
    614614            $slug = substr( md5( uniqid( microtime() ) ), 0, 7);
    615615        $ext = preg_replace( '|.*/([a-z0-9]+)|', '$1', $_SERVER['CONTENT_TYPE'] );
    616         $slug = "$slug.$ext";
     616        $slug = sanitize_file_name( "$slug.$ext" );
    617617        $file = wp_upload_bits( $slug, NULL, $bits);
    618618
Note: See TracChangeset for help on using the changeset viewer.