Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

+26 -27
View File
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Compare and highlight differences between two strings or files
* Last Updated: $Date: 2010-04-21 07:40:53 -0400 (Wed, 21 Apr 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: matt $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Kernel
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since Thursday 10th February 2005 (10:47)
* @version $Revision: 394 $
* @version $Revision: 8644 $
*/
if ( ! defined( 'IPS_CLASSES_PATH' ) )
@@ -66,7 +66,7 @@ class classDifference
* Constructor
*
* @access public
* @return void
* @return @e void
*/
public function __construct()
{
@@ -208,12 +208,12 @@ class classDifference
/**
* Adds space character after HTML tags
*
* @access private
* @access protected
* @param string String
* @param integer [Optional][0=reverse, 1=normal]
* @return string Converted string
*/
private function _diffTagSpace( $str, $rev=0 )
protected function _diffTagSpace( $str, $rev=0 )
{
if ( $rev )
{
@@ -228,11 +228,11 @@ class classDifference
/**
* Explodes input string into words
*
* @access private
* @access protected
* @param string Input string
* @return array Array of words in string
*/
private function _diffExplodeStringIntoWords( $str )
protected function _diffExplodeStringIntoWords( $str )
{
$str_array = $this->_explodeTrim( chr(10), $str );
$out_array = array();
@@ -253,13 +253,13 @@ class classDifference
/**
* Explode into array and trim
*
* @access private
* @access protected
* @param string Delimiter
* @param string String to check
* @param integer [Optional] Remove blank lines
* @return array Array of lines in string
*/
private function _explodeTrim( $delim, $str, $remove_blank=0 )
protected function _explodeTrim( $delim, $str, $remove_blank=0 )
{
$tmp = explode( $delim, trim($str) );
$final = array();
@@ -282,26 +282,26 @@ class classDifference
/**
* Produce differences using PHP
*
* @access private
* @access protected
* @param string comapre string 1
* @param string comapre string 2
* @return string
*/
private function _getPhpDiff( $str1 , $str2 )
protected function _getPhpDiff( $str1 , $str2 )
{
$str1 = explode( "\n", str_replace( "\r\n", "\n", $str1 ) );
$str2 = explode( "\n", str_replace( "\r\n", "\n", $str2 ) );
/* Set include path.. */
@set_include_path( IPS_KERNEL_PATH . 'PEAR/' );
@set_include_path( IPS_KERNEL_PATH . 'PEAR/' );/*noLibHook*/
/* OMG.. too many PHP 5 errors under strict standards */
$oldReportLevel = error_reporting( 0 );
error_reporting( $oldReportLevel ^ E_STRICT );
require_once 'Text/Diff.php';
require_once 'Text/Diff/Renderer.php';
require_once 'Text/Diff/Renderer/inline.php';
require_once 'Text/Diff.php';/*noLibHook*/
require_once 'Text/Diff/Renderer.php';/*noLibHook*/
require_once 'Text/Diff/Renderer/inline.php';/*noLibHook*/
$diff = new Text_Diff( 'auto', array( $str1, $str2 ) );
@@ -333,12 +333,12 @@ class classDifference
/**
* Produce differences using unix diff
*
* @access private
* @access protected
* @param string comapre string 1
* @param string comapre string 2
* @return string
*/
private function _getExecDiff( $str1, $str2 )
protected function _getExecDiff( $str1, $str2 )
{
//-------------------------------
// Write the tmp files
@@ -363,7 +363,7 @@ class classDifference
// Check
//-------------------------------
if ( file_exists( $file1 ) and file_exists( $file2 ) )
if ( is_file( $file1 ) and is_file( $file2 ) )
{
exec( $this->diff_command.' '.$file1.' '.$file2, $result );
@@ -381,20 +381,19 @@ class classDifference
/**
* Produce differences using CGI
*
* @access private
* @access protected
* @param string comapre string 1
* @param string comapre string 2
* @return string
*/
private function _getCgiDiff( $str1, $str2 )
protected function _getCgiDiff( $str1, $str2 )
{
//-----------------------------------------
// Load file management class
//-----------------------------------------
require_once( IPS_KERNEL_PATH . '/classFileManagement.php' );
require_once( IPS_KERNEL_PATH . '/classFileManagement.php' );/*noLibHook*/
$this->classFileManagement = new classFileManagement();
$this->classFileManagement->use_sockets = ipsRegistry::$settings['enable_sockets'];
//-------------------------------
// Write the tmp files
@@ -419,7 +418,7 @@ class classDifference
// Check
//-------------------------------
if ( file_exists( IPS_ROOT_PATH . 'uploads/' . $file1 ) AND file_exists( IPS_ROOT_PATH . 'uploads/' . $file2 ) )
if ( is_file( IPS_ROOT_PATH . 'uploads/' . $file1 ) AND is_file( IPS_ROOT_PATH . 'uploads/' . $file2 ) )
{
$result = $this->classFileManagement->getFileContents( ipsRegistry::$settings['board_url'] . "/" . CP_DIRECTORY . "/" . IPS_CGI_DIRECTORY . "/cgi_getdifference.cgi" );