Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #28811


Ignore:
Timestamp:
07/10/2014 02:37:34 PM (11 years ago)
Author:
SergeyBiryukov
Comment:

Related: #15598, #16457, #17494, #20849.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28811 – Description

    initial v1  
    66[http://wordpress.org/support/topic/wp-crash-after-moved-to-other-server-1] (1 month ago)
    77
    8 I know that someone complained about this once before here: [https://core.trac.wordpress.org/ticket/20849] and it was closed as "invalid", but I would like to re-raise this issue, with an alternative solution.  I do understand that no one wants to make unnecessary search/replace calls to "correct" the slash for the Linux machines.  However, I also hope that you can see the benefit with building the paths correctly in the first place with the DIRECTORY_SEPARATOR, so that things behave more consistently for both linux and windows users alike.
     8I know that someone complained about this once before here: #20849 and it was closed as "invalid", but I would like to re-raise this issue, with an alternative solution.  I do understand that no one wants to make unnecessary search/replace calls to "correct" the slash for the Linux machines.  However, I also hope that you can see the benefit with building the paths correctly in the first place with the DIRECTORY_SEPARATOR, so that things behave more consistently for both linux and windows users alike.
    99
    1010My proposed fix is simple enough:
    11 Edit both: {DOCROOT}\wp_load.php & {DOCROOT}\wp_config.php (and any other place that defines ABSPATH)
     11Edit both: `{DOCROOT}\wp_load.php` & `{DOCROOT}\wp_config.php` (and any other place that defines ABSPATH)
    1212
    13 Find: define( 'ABSPATH', dirname(__FILE__) . '/' );
    14 Replace with: define('ABSPATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
     13Find: `define( 'ABSPATH', dirname(__FILE__) . '/' );`
     14Replace with: `define('ABSPATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);`
    1515
    1616Be careful with the following "finds" you are looking for things that end in DIR NOT URL!!!
    1717
    18 Edit {DOCROOT}\wp-includes\default_constants.php
    19 Find: define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
    20 Replace with: define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' );
    21 Find: define( 'PLUGINDIR', 'wp-content/plugins' );
    22 Replace with: define( 'PLUGINDIR', 'wp-content'.DIRECTORY_SEPARATOR .'plugins' );
    23 Find: define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );
    24 Replace with: define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . DIRECTORY_SEPARATOR .'mu-plugins' );
    25 Find: define( 'MUPLUGINDIR', 'wp-content/mu-plugins' );
    26 Replace with: define( 'MUPLUGINDIR', 'wp-content'.DIRECTORY_SEPARATOR .'mu-plugins' );
     18Edit `{DOCROOT}\wp-includes\default_constants.php`
     19Find: `define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );`
     20Replace with: `define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' );`
     21Find: `define( 'PLUGINDIR', 'wp-content/plugins' );`
     22Replace with: `define( 'PLUGINDIR', 'wp-content'.DIRECTORY_SEPARATOR .'plugins' );`
     23Find: `define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' );`
     24Replace with: `define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . DIRECTORY_SEPARATOR .'mu-plugins' );`
     25Find: `define( 'MUPLUGINDIR', 'wp-content/mu-plugins' );`
     26Replace with: `define( 'MUPLUGINDIR', 'wp-content'.DIRECTORY_SEPARATOR .'mu-plugins' );`
    2727
    2828I can't say for certain how many places where the DIRECTORY_SEPARATOR is needed, but you get the idea what to do to fix it from that sampling of edits.