Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,18 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Compare and highlight differences between two strings or files
|
||||
* Last Updated: $Date: 2009-03-24 17:32:58 -0400 (Tue, 24 Mar 2009) $
|
||||
* Last Updated: $Date: 2010-04-21 07:40:53 -0400 (Wed, 21 Apr 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Services Kernel
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Kernel
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Thursday 10th February 2005 (10:47)
|
||||
* @version $Revision: 249 $
|
||||
* @version $Revision: 394 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IPS_CLASSES_PATH' ) )
|
||||
@@ -89,10 +92,13 @@ class classDifference
|
||||
{
|
||||
$this->diff_found = 0;
|
||||
|
||||
$str1 = $this->_diffTagSpace($str1);
|
||||
$str2 = $this->_diffTagSpace($str2);
|
||||
$str1_lines = $this->_diffExplodeStringIntoWords($str1);
|
||||
$str2_lines = $this->_diffExplodeStringIntoWords($str2);
|
||||
if ( $this->method != 'PHP' )
|
||||
{
|
||||
$str1 = $this->_diffTagSpace($str1);
|
||||
$str2 = $this->_diffTagSpace($str2);
|
||||
$str1_lines = $this->_diffExplodeStringIntoWords($str1);
|
||||
$str2_lines = $this->_diffExplodeStringIntoWords($str2);
|
||||
}
|
||||
|
||||
if ( $this->method == 'CGI' )
|
||||
{
|
||||
@@ -100,7 +106,7 @@ class classDifference
|
||||
}
|
||||
else if ( $this->method == 'PHP' )
|
||||
{
|
||||
$diff_res = $this->_getPhpDiff( implode( chr(10), $str1_lines ) . chr(10), implode( chr(10), $str2_lines ) . chr(10) );
|
||||
$diff_res = $this->_getPhpDiff( $str1, $str2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -227,7 +233,7 @@ class classDifference
|
||||
* @return array Array of words in string
|
||||
*/
|
||||
private function _diffExplodeStringIntoWords( $str )
|
||||
{
|
||||
{
|
||||
$str_array = $this->_explodeTrim( chr(10), $str );
|
||||
$out_array = array();
|
||||
|
||||
@@ -282,7 +288,7 @@ class classDifference
|
||||
* @return string
|
||||
*/
|
||||
private function _getPhpDiff( $str1 , $str2 )
|
||||
{
|
||||
{
|
||||
$str1 = explode( "\n", str_replace( "\r\n", "\n", $str1 ) );
|
||||
$str2 = explode( "\n", str_replace( "\r\n", "\n", $str2 ) );
|
||||
|
||||
@@ -318,8 +324,8 @@ class classDifference
|
||||
$this->post_process = 0;
|
||||
|
||||
# Convert lines to a space, and two spaces to a single line
|
||||
$result = str_replace(' ', chr(10), str_replace( "\n", " ", $result ) );
|
||||
$result = $this->_diffTagSpace($result,1);
|
||||
//$result = str_replace(' ', chr(10), str_replace( "\n", " ", $result ) );
|
||||
//$result = $this->_diffTagSpace($result,1);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user