WordPress.org

Make WordPress Core

Changeset 34866


Ignore:
Timestamp:
10/06/2015 02:13:49 PM (6 years ago)
Author:
wonderboymusic
Message:

Media: in wp_read_video|audio_metadata(), set GETID3_TEMP_DIR to get_temp_dir() if it is not defined. This is a workaround for when safe_mode is enabled pre-PHP 5.3.

Props chriscct7, tomsommer.
Fixes #26265.

File:
1 edited

Legend:

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

    r34823 r34866  
    29702970 */
    29712971function wp_read_video_metadata( $file ) {
    2972     if ( ! file_exists( $file ) )
     2972    if ( ! file_exists( $file ) ) {
    29732973        return false;
     2974    }
    29742975
    29752976    $metadata = array();
    29762977
    2977     if ( ! class_exists( 'getID3', false ) )
     2978    if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
     2979        define( 'GETID3_TEMP_DIR', get_temp_dir() );
     2980    }
     2981
     2982    if ( ! class_exists( 'getID3', false ) ) {
    29782983        require( ABSPATH . WPINC . '/ID3/getid3.php' );
     2984    }
    29792985    $id3 = new getID3();
    29802986    $data = $id3->analyze( $file );
     
    30263032 */
    30273033function wp_read_audio_metadata( $file ) {
    3028     if ( ! file_exists( $file ) )
     3034    if ( ! file_exists( $file ) ) {
    30293035        return false;
     3036    }
    30303037    $metadata = array();
    30313038
    3032     if ( ! class_exists( 'getID3', false ) )
     3039    if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
     3040        define( 'GETID3_TEMP_DIR', get_temp_dir() );
     3041    }
     3042
     3043    if ( ! class_exists( 'getID3', false ) ) {
    30333044        require( ABSPATH . WPINC . '/ID3/getid3.php' );
     3045    }
    30343046    $id3 = new getID3();
    30353047    $data = $id3->analyze( $file );
Note: See TracChangeset for help on using the changeset viewer.