phpBB

Code Changes

File: includes/diff/renderer.php

  Unmodified   Added   Modified   Removed
Line 128Line 128
				if (is_array($block))
{
// How many lines to keep as context from the copy block.

				if (is_array($block))
{
// How many lines to keep as context from the copy block.

					$keep = ($i == sizeof($diffs) - 1) ? $ntrail : $nlead + $ntrail;
if (sizeof($edit->orig) <= $keep)

					$keep = ($i == count($diffs) - 1) ? $ntrail : $nlead + $ntrail;
if (count($edit->orig) <= $keep)

					{
// We have less lines in the block than we want for context => keep the whole block.
$block[] = $edit;

					{
// We have less lines in the block than we want for context => keep the whole block.
$block[] = $edit;

Line 156Line 156
				if (!is_array($block))
{
// Extract context lines from the preceding copy block.

				if (!is_array($block))
{
// Extract context lines from the preceding copy block.

					$context = array_slice($context, sizeof($context) - $nlead);
$x0 = $xi - sizeof($context);
$y0 = $yi - sizeof($context);

					$context = array_slice($context, count($context) - $nlead);
$x0 = $xi - count($context);
$y0 = $yi - count($context);

					$block = array();

if ($context)

					$block = array();

if ($context)

Line 169Line 169
				$block[] = $edit;
}


				$block[] = $edit;
}


			$xi += ($edit->orig) ? sizeof($edit->orig) : 0;
$yi += ($edit->final) ? sizeof($edit->final) : 0;

			$xi += ($edit->orig) ? count($edit->orig) : 0;
$yi += ($edit->final) ? count($edit->final) : 0;

		}

if (is_array($block))

		}

if (is_array($block))

Line 433Line 433
	{
array_walk($lines, array(&$this, '_encode'));
$lines[0] = $this->_ins_prefix . $lines[0];

	{
array_walk($lines, array(&$this, '_encode'));
$lines[0] = $this->_ins_prefix . $lines[0];

		$lines[sizeof($lines) - 1] .= $this->_ins_suffix;

		$lines[count($lines) - 1] .= $this->_ins_suffix;

		return $this->_lines($lines, ' ', false);
}


		return $this->_lines($lines, ' ', false);
}


Line 441Line 441
	{
array_walk($lines, array(&$this, '_encode'));
$lines[0] = $this->_del_prefix . $lines[0];

	{
array_walk($lines, array(&$this, '_encode'));
$lines[0] = $this->_del_prefix . $lines[0];

		$lines[sizeof($lines) - 1] .= $this->_del_suffix;

		$lines[count($lines) - 1] .= $this->_del_suffix;

		return $this->_lines($lines, ' ', false);
}


		return $this->_lines($lines, ' ', false);
}


Line 617Line 617
		$this->render($diff);

// Is the diff empty?

		$this->render($diff);

// Is the diff empty?

		if (!sizeof($this->lines))

		if (!count($this->lines))

		{
$output .= '<tr><th colspan="2">' . $user->lang['NO_VISIBLE_CHANGES'] . '</th></tr>';
}

		{
$output .= '<tr><th colspan="2">' . $user->lang['NO_VISIBLE_CHANGES'] . '</th></tr>';
}

Line 672Line 672

case 'change':
// Pop the old/new stacks one by one, until both are empty.


case 'change':
// Pop the old/new stacks one by one, until both are empty.

							$oldsize = sizeof($change['old']);
$newsize = sizeof($change['new']);

							$oldsize = count($change['old']);
$newsize = count($change['new']);

							$left = $right = '';

for ($row = 0, $row_max = max($oldsize, $newsize); $row < $row_max; ++$row)

							$left = $right = '';

for ($row = 0, $row_max = max($oldsize, $newsize); $row < $row_max; ++$row)