Fix Text/Diff includes. Props codestyling. fixes #7391 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@8581 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
80a4ec8e37
commit
ea522c10c9
@ -49,7 +49,8 @@ class Text_Diff {
|
|||||||
$engine = basename($engine);
|
$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;
|
$class = 'Text_Diff_Engine_' . $engine;
|
||||||
$diff_engine = new $class();
|
$diff_engine = new $class();
|
||||||
|
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** Text_Diff_Renderer */
|
/** Text_Diff_Renderer */
|
||||||
require_once 'Text/Diff/Renderer.php';
|
|
||||||
|
// WP #7391
|
||||||
|
require_once dirname(dirname(__FILE__)) . '/Renderer.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "Inline" diff renderer.
|
* "Inline" diff renderer.
|
||||||
|
@ -1530,10 +1530,6 @@ function wp_text_diff( $left_string, $right_string, $args = null ) {
|
|||||||
$defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
|
$defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$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' ) )
|
if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) )
|
||||||
require( ABSPATH . WPINC . '/wp-diff.php' );
|
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();
|
$renderer = new WP_Text_Diff_Renderer_Table();
|
||||||
$diff = $renderer->render($text_diff);
|
$diff = $renderer->render($text_diff);
|
||||||
|
|
||||||
ini_restore('include_path');
|
|
||||||
|
|
||||||
if ( !$diff )
|
if ( !$diff )
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ( !class_exists( 'Text_Diff' ) ) {
|
if ( !class_exists( 'Text_Diff' ) ) {
|
||||||
require( 'Text/Diff.php' );
|
require( dirname(__FILE__).'/Text/Diff.php' );
|
||||||
require( 'Text/Diff/Renderer.php' );
|
require( dirname(__FILE__).'/Text/Diff/Renderer.php' );
|
||||||
require( 'Text/Diff/Renderer/inline.php' );
|
require( dirname(__FILE__).'/Text/Diff/Renderer/inline.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user