aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/diff/engine.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-07-28 13:27:08 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-07-28 13:27:08 +0000
commitbba6488d3d085ebfe398c1026d58179120fe5c26 (patch)
tree05267f3bf81f0bd1814f8eba64ce4c9fa2b31acd /phpBB/includes/diff/engine.php
parent8904d95d59d14d00fd3cfaf93a357ad68d608586 (diff)
downloadforums-bba6488d3d085ebfe398c1026d58179120fe5c26.tar
forums-bba6488d3d085ebfe398c1026d58179120fe5c26.tar.gz
forums-bba6488d3d085ebfe398c1026d58179120fe5c26.tar.bz2
forums-bba6488d3d085ebfe398c1026d58179120fe5c26.tar.xz
forums-bba6488d3d085ebfe398c1026d58179120fe5c26.zip
some diff engine updates (only minor, but will hopefully not break anything)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8692 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/diff/engine.php')
-rw-r--r--phpBB/includes/diff/engine.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php
index 576839ea60..ebf1469d67 100644
--- a/phpBB/includes/diff/engine.php
+++ b/phpBB/includes/diff/engine.php
@@ -17,21 +17,20 @@ if (!defined('IN_PHPBB'))
}
/**
-* Code from pear.php.net, Text_Diff-0.2.1 (beta) package
-* http://pear.php.net/package/Text_Diff/
+* Code from pear.php.net, Text_Diff-1.0.0 package
+* http://pear.php.net/package/Text_Diff/ (native engine)
*
* Modified by phpBB Group to meet our coding standards
* and being able to integrate into phpBB
*
-* Class used internally by Diff to actually compute the diffs. This class is
-* implemented using native PHP code.
+* Class used internally by Text_Diff to actually compute the diffs. This
+* class is implemented using native PHP code.
*
* The algorithm used here is mostly lifted from the perl module
* Algorithm::Diff (version 1.06) by Ned Konz, which is available at:
* http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
*
-* More ideas are taken from:
-* http://www.ics.uci.edu/~eppstein/161/960229.html
+* More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html
*
* Some ideas (and a bit of code) are taken from analyze.c, of GNU
* diffutils-2.7, which can be found at:
@@ -41,6 +40,8 @@ if (!defined('IN_PHPBB'))
* Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
* code was written by him, and is used/adapted with his permission.
*
+* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
+*
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
* @package diff
*
@@ -251,7 +252,7 @@ class diff_engine
}
}
- $x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks);
+ $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);
for (; $x < $x1; $x++)
{
@@ -262,7 +263,8 @@ class diff_engine
}
$matches = $ymatches[$line];
- foreach ($matches as $y)
+ reset($matches);
+ while (list(, $y) = each($matches))
{
if (empty($this->in_seq[$y]))
{
@@ -273,7 +275,7 @@ class diff_engine
}
// no reset() here
- while (list($junk, $y) = each($matches))
+ while (list(, $y) = each($matches))
{
if ($y > $this->seq[$k - 1])
{