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. git-svn-id: https://develop.svn.wordpress.org/trunk@34866 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b054b952bc
commit
bb2c59c3a8
@ -2969,13 +2969,19 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
|
||||
* @return array|bool Returns array of metadata, if found.
|
||||
*/
|
||||
function wp_read_video_metadata( $file ) {
|
||||
if ( ! file_exists( $file ) )
|
||||
if ( ! file_exists( $file ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$metadata = array();
|
||||
|
||||
if ( ! class_exists( 'getID3', false ) )
|
||||
if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
|
||||
define( 'GETID3_TEMP_DIR', get_temp_dir() );
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'getID3', false ) ) {
|
||||
require( ABSPATH . WPINC . '/ID3/getid3.php' );
|
||||
}
|
||||
$id3 = new getID3();
|
||||
$data = $id3->analyze( $file );
|
||||
|
||||
@ -3025,12 +3031,18 @@ function wp_read_video_metadata( $file ) {
|
||||
* @return array|bool Returns array of metadata, if found.
|
||||
*/
|
||||
function wp_read_audio_metadata( $file ) {
|
||||
if ( ! file_exists( $file ) )
|
||||
if ( ! file_exists( $file ) ) {
|
||||
return false;
|
||||
}
|
||||
$metadata = array();
|
||||
|
||||
if ( ! class_exists( 'getID3', false ) )
|
||||
if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
|
||||
define( 'GETID3_TEMP_DIR', get_temp_dir() );
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'getID3', false ) ) {
|
||||
require( ABSPATH . WPINC . '/ID3/getid3.php' );
|
||||
}
|
||||
$id3 = new getID3();
|
||||
$data = $id3->analyze( $file );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user