WordPress.org

Make WordPress Core

Changeset 46210


Ignore:
Timestamp:
09/20/2019 08:45:58 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r46206 r46210  
    9696function get_file( $path ) {
    9797
    98     if ( function_exists( 'realpath' ) ) {
    99         $path = realpath( $path );
    100     }
     98    $path = realpath( $path );
    10199
    102100    if ( ! $path || ! @is_file( $path ) ) {
  • trunk/src/wp-includes/class-wp-editor.php

    r45932 r46210  
    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' ) ) {
Note: See TracChangeset for help on using the changeset viewer.