From 642c8d9b54166f4171d08a2ec6f8ab3c88a967e3 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 7 Aug 2008 21:02:07 +0000 Subject: [PATCH] Fix Text/Diff includes. Props codestyling. fixes #7391 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@8581 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/Text/Diff.php | 3 ++- wp-includes/Text/Diff/Renderer/inline.php | 4 +++- wp-includes/pluggable.php | 6 ------ wp-includes/wp-diff.php | 6 +++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/wp-includes/Text/Diff.php b/wp-includes/Text/Diff.php index f8a974c1c..06d1c6c76 100644 --- a/wp-includes/Text/Diff.php +++ b/wp-includes/Text/Diff.php @@ -49,7 +49,8 @@ class Text_Diff { $engine = basename($engine); } - require_once 'Text/Diff/Engine/' . $engine . '.php'; + // WP #7391 + require_once dirname(__FILE__).'/Diff/Engine/' . $engine . '.php'; $class = 'Text_Diff_Engine_' . $engine; $diff_engine = new $class(); diff --git a/wp-includes/Text/Diff/Renderer/inline.php b/wp-includes/Text/Diff/Renderer/inline.php index b547ff236..1493eaa04 100644 --- a/wp-includes/Text/Diff/Renderer/inline.php +++ b/wp-includes/Text/Diff/Renderer/inline.php @@ -14,7 +14,9 @@ */ /** Text_Diff_Renderer */ -require_once 'Text/Diff/Renderer.php'; + +// WP #7391 +require_once dirname(dirname(__FILE__)) . '/Renderer.php'; /** * "Inline" diff renderer. diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index b9409669a..34d5b426e 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1530,10 +1530,6 @@ function wp_text_diff( $left_string, $right_string, $args = null ) { $defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' ); $args = wp_parse_args( $args, $defaults ); - // PEAR Text_Diff is lame; it includes things from include_path rather than it's own path. - // Not sure of the ramifications of disttributing modified code. - ini_set('include_path', '.' . PATH_SEPARATOR . ABSPATH . WPINC ); - if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) ) require( ABSPATH . WPINC . '/wp-diff.php' ); @@ -1552,8 +1548,6 @@ function wp_text_diff( $left_string, $right_string, $args = null ) { $renderer = new WP_Text_Diff_Renderer_Table(); $diff = $renderer->render($text_diff); - ini_restore('include_path'); - if ( !$diff ) return ''; diff --git a/wp-includes/wp-diff.php b/wp-includes/wp-diff.php index 77f325812..e43903d80 100644 --- a/wp-includes/wp-diff.php +++ b/wp-includes/wp-diff.php @@ -1,9 +1,9 @@