Make WordPress Core

Ticket #48075: 48075-src-Remove-work-arounds-for-realpath.patch

File 48075-src-Remove-work-arounds-for-realpath.patch, 1.4 KB (added by jrf, 5 years ago)
  • src/wp-admin/includes/noop.php

    From 663e29189fa86c421909ca98d6ba865d42156037 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Sat, 27 Jul 2019 04:31:28 +0200
    Subject: [PATCH] [src] Remove work-arounds for realpath()
    
    ---
     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 134bef7efe..4c0b9e7c78 100644
    a b endif; 
    102102
    103103function get_file( $path ) {
    104104
    105         if ( function_exists( 'realpath' ) ) {
    106                 $path = realpath( $path );
    107         }
     105        $path = realpath( $path );
    108106
    109107        if ( ! $path || ! @is_file( $path ) ) {
    110108                return '';
  • src/wp-includes/class-wp-editor.php

    diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php
    index d980dca3c8..0aaeae6166 100644
    a b final class _WP_Editors { 
    491491                                                                $path = str_replace( content_url(), '', $plugurl );
    492492                                                                $path = WP_CONTENT_DIR . $path . '/langs/';
    493493
    494                                                                 if ( function_exists( 'realpath' ) ) {
    495                                                                         $path = trailingslashit( realpath( $path ) );
    496                                                                 }
     494                                                                $path = trailingslashit( realpath( $path ) );
    497495
    498496                                                                if ( @is_file( $path . $mce_locale . '.js' ) ) {
    499497                                                                        $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";