WordPress.org

Make WordPress Core

Ticket #7391: 7391.r8561.2.6.diff

File 7391.r8561.2.6.diff, 2.0 KB (added by santosj, 6 years ago)

Set include path in wp-settings for 2.6 r8561

  • wp-includes/pluggable.php

     
    15091509 * @return string Empty string if strings are equivalent or HTML with differences. 
    15101510 */ 
    15111511function wp_text_diff( $left_string, $right_string, $args = null ) { 
     1512        if ( defined( 'WP_INCLUDE_PATH_DISABLED' ) ) 
     1513                return ''; 
     1514 
    15121515        $defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' ); 
    15131516        $args = wp_parse_args( $args, $defaults ); 
    15141517 
    1515         // PEAR Text_Diff is lame; it includes things from include_path rather than it's own path. 
    1516         // Not sure of the ramifications of disttributing modified code. 
    1517         ini_set('include_path', '.' . PATH_SEPARATOR . ABSPATH . WPINC ); 
    1518  
    15191518        if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) ) 
    15201519                require( ABSPATH . WPINC . '/wp-diff.php' ); 
    15211520 
     
    15341533        $renderer  = new WP_Text_Diff_Renderer_Table(); 
    15351534        $diff = $renderer->render($text_diff); 
    15361535 
    1537         ini_restore('include_path'); 
    1538  
    15391536        if ( !$diff ) 
    15401537                return ''; 
    15411538 
  • wp-settings.php

     
    182182 */ 
    183183define('WPINC', 'wp-includes'); 
    184184 
     185if ( constant('WP_POST_REVISIONS') ) { 
     186        /* 
     187         * PEAR Text_Diff depends on the include path matching its directory 
     188         * structure. This prevents modifying source code and maintaining the 
     189         * modifications when the package is updated. 
     190         */ 
     191        if ( function_exists( 'set_include_path' ) ) 
     192                set_include_path( get_include_path() . PATH_SEPARATOR . ABSPATH . WPINC ); 
     193        else if ( function_exists( 'ini_set' ) ) 
     194                ini_set( 'include_path',  ini_get('include_path') . PATH_SEPARATOR . ABSPATH . WPINC ); 
     195        else 
     196                define('WP_INCLUDE_PATH_DISABLED', true); 
     197} 
     198 
    185199if ( !defined('WP_LANG_DIR') ) { 
    186200        /** 
    187201         * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR