From a6e323fae81959f08ac741729b0acb80f2e77d1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 May 2018 11:16:06 +0200 Subject: [PATCH] Fix bad usage of "for" loop --- htdocs/ticketsup/class/utils_diff.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/ticketsup/class/utils_diff.class.php b/htdocs/ticketsup/class/utils_diff.class.php index bd9e0e2d5ca..a8e3712ec9b 100644 --- a/htdocs/ticketsup/class/utils_diff.class.php +++ b/htdocs/ticketsup/class/utils_diff.class.php @@ -1,11 +1,11 @@ - * + * * A class containing a diff implementation * * Created by Stephen Morley - http://stephenmorley.org/ - and released under the * terms of the CC0 1.0 Universal legal code: - * + * * http://creativecommons.org/publicdomain/zero/1.0/legalcode */ @@ -80,9 +80,9 @@ class Diff $diff[] = array_pop($partialDiff); } - for ($index = $end1 + 1; - $index < ($compareCharacters ? strlen($sequence1) : count($sequence1)); - $index++) { + $end2 = ($compareCharacters ? strlen($sequence1) : count($sequence1)); + for ($index = $end1 + 1; $index < $end2; $index++) + { $diff[] = array($sequence1[$index], self::UNMODIFIED); } @@ -382,7 +382,7 @@ class Diff * $index - the current index, passes by reference * $type - the type of line */ - private static function getCellContent($diff, $indentation, $separator, &$index, $type) + private static function getCellContent($diff, $indentation, $separator, &$index, $type) { // initialise the HTML $html = '';