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
This commit is contained in:
ryan 2008-08-07 21:02:07 +00:00
parent 57e2267904
commit 642c8d9b54
4 changed files with 8 additions and 11 deletions

View File

@ -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();

View File

@ -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.

View File

@ -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 '';

View File

@ -1,9 +1,9 @@
<?php
if ( !class_exists( 'Text_Diff' ) ) {
require( 'Text/Diff.php' );
require( 'Text/Diff/Renderer.php' );
require( 'Text/Diff/Renderer/inline.php' );
require( dirname(__FILE__).'/Text/Diff.php' );
require( dirname(__FILE__).'/Text/Diff/Renderer.php' );
require( dirname(__FILE__).'/Text/Diff/Renderer/inline.php' );
}