diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:40 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:40 +0100 |
| commit | 021c186be91095397d4e76801738373989360a52 (patch) | |
| tree | 4a5b42c0ebcaeb0be77edacb839bf164fe2dadc0 /phpBB/includes/diff/engine.php | |
| parent | 4f9c3b8f5c0181c2ebf367436f3c0336d8f2251d (diff) | |
| parent | 3ddedd5ff228cdcc3c0b05000affe3944afc7854 (diff) | |
| download | forums-021c186be91095397d4e76801738373989360a52.tar forums-021c186be91095397d4e76801738373989360a52.tar.gz forums-021c186be91095397d4e76801738373989360a52.tar.bz2 forums-021c186be91095397d4e76801738373989360a52.tar.xz forums-021c186be91095397d4e76801738373989360a52.zip | |
Merge commit 'release-3.0.6-RC1'
Diffstat (limited to 'phpBB/includes/diff/engine.php')
| -rw-r--r-- | phpBB/includes/diff/engine.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php index eb0dcce395..e9f0e41b75 100644 --- a/phpBB/includes/diff/engine.php +++ b/phpBB/includes/diff/engine.php @@ -49,6 +49,8 @@ if (!defined('IN_PHPBB')) */ class diff_engine { + var $skip_whitespace_changes = true; + function diff(&$from_lines, &$to_lines, $preserve_cr = true) { // Remove empty lines... @@ -176,6 +178,20 @@ class diff_engine $add[] = $to_lines[$yi++]; } + // Here we are a bit naughty. Naughty Boy... Naughty Boy... + // We check if delete and add is filled and only consist of one item + if ($this->skip_whitespace_changes && sizeof($delete) == 1 && sizeof($add) == 1) + { + // Now we simply trim the string and see if the lines are identical + // If they are identical we do not need to take them into account for the merge (less conflicts in phpBB) + if (trim($delete[0]) === trim($add[0])) + { + // This line ensures the line found here is correctly copied later (remember: we naughty boys like loops) + $xi--; $yi--; $this->xchanged[$xi] = $this->ychanged[$yi] = false; + $delete = $add = array(); + } + } + if ($delete && $add) { $edits[] = new diff_op_change($delete, $add); |
