From 6b65af939fe4693fd8667dc12c8383c11fef2fa6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Sep 2019 20:45:58 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@46210 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/noop.php | 4 +--- src/wp-includes/class-wp-editor.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/includes/noop.php b/src/wp-admin/includes/noop.php index 6e2397ea2e..ba611fc9e1 100644 --- a/src/wp-admin/includes/noop.php +++ b/src/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/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index d980dca3c8..0aaeae6166 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/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";