From a9aefc83bcc2b58dddc6f4dfffa476febc8122e2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Sep 2019 20:46:56 +0000 Subject: [PATCH] Code Modernization: Remove conditional use of PHP `realpath()`. The `realpath()` function was introduced in PHP 4.0.0. There's no point in checking if the function exists in PHP 5.6+, in only 2 instances out of 29. Props jrf. Fixes #48075. Built from https://develop.svn.wordpress.org/trunk@46210 git-svn-id: http://core.svn.wordpress.org/trunk@46022 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/noop.php | 4 +--- wp-includes/class-wp-editor.php | 4 +--- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/wp-admin/includes/noop.php b/wp-admin/includes/noop.php index 6e2397ea2e..ba611fc9e1 100644 --- a/wp-admin/includes/noop.php +++ b/wp-admin/includes/noop.php @@ -95,9 +95,7 @@ function wp_guess_url() {} function get_file( $path ) { - if ( function_exists( 'realpath' ) ) { - $path = realpath( $path ); - } + $path = realpath( $path ); if ( ! $path || ! @is_file( $path ) ) { return ''; diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index d980dca3c8..0aaeae6166 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -491,9 +491,7 @@ final class _WP_Editors { $path = str_replace( content_url(), '', $plugurl ); $path = WP_CONTENT_DIR . $path . '/langs/'; - if ( function_exists( 'realpath' ) ) { - $path = trailingslashit( realpath( $path ) ); - } + $path = trailingslashit( realpath( $path ) ); if ( @is_file( $path . $mce_locale . '.js' ) ) { $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n"; diff --git a/wp-includes/version.php b/wp-includes/version.php index 40de1beba0..c1b98412c9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46209'; +$wp_version = '5.3-alpha-46210'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.