1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-08 08:35:31 +02:00

Merge r10522 into 3.0.7 branch

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_7@10523 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2010-02-23 16:09:02 +00:00
parent 4f439593ce
commit bffd7eb6a7

@ -1181,7 +1181,19 @@ class BBCodeDiffFormatter extends DiffFormatter
$text = implode('', $order_array['find_c']);
if ($text === "\n" || $text === "\t" || $text === '')
{
return true;
if (isset($order_array['first_find_c'][0]) &&
is_array($order_array['first_find_c'][0]) &&
trim(implode('', $order_array['first_find_c'][0])) != '' &&
isset($order_array['replace']))
{
$order_array['add'] = $order_array['replace'];
unset($order_array['replace']);
// this is actually an after add
}
else
{
return true;
}
}
}
@ -1223,18 +1235,42 @@ class BBCodeDiffFormatter extends DiffFormatter
$text = implode('', $order_array['find_c']);
if ($text === "\n" || $text === "\t" || $text === '')
{
continue;
// no real find, use first_find_c if possible!
//var_dump($order_array);
if (is_array($order_array['first_find_c'][0]))
{
$order_array['find_c'] = $order_array['first_find_c'][0];
}
else
{
if (isset($order_array['replace']) || isset($order_array['add']) || isset($order_array['delete']))
{
echo "skipped an edit!\n";
var_dump($order_array);
}
continue;
}
}
if (strlen(implode('', $order_array['find_c'])) < 50 && is_array($order_array['first_find_c'][0]))
else
{
$html .= "#\n#-----[ FIND ]---------------------------------------------\n# Around Line {$ybeg}\n";
$html .= implode("", $order_array['first_find_c'][0]);
$html .= "\n";
$ybeg += sizeof($order_array['first_find_c'][0]);
if (strlen(implode('', $order_array['find_c'])) < 50 && is_array($order_array['first_find_c'][0]))
{
$html .= "#\n#-----[ FIND ]---------------------------------------------\n# Around Line {$ybeg}\n";
$html .= implode("", $order_array['first_find_c'][0]);
$html .= "\n";
$ybeg += sizeof($order_array['first_find_c'][0]);
}
}
}
// still here but nothing to do? what the heck?
if (!isset($order_array['replace']) && !isset($order_array['add']) && !isset($order_array['delete']))
{
echo "skipped an edit!\n";
var_dump($order_array);
continue;
}
if (sizeof($order_array['find_c']))
{
$html .= "#\n#-----[ FIND ]---------------------------------------------\n# Around Line {$ybeg}\n";
@ -1309,7 +1345,7 @@ class BBCodeDiffFormatter extends DiffFormatter
{
if (isset($hunk['a']) && isset($hunk['d']))
{
/* if (sizeof($hunk['a']) == 1 && sizeof($hunk['d']) == 1)
/**/ if (sizeof($hunk['a']) == 1 && sizeof($hunk['d']) == 1)
{
if (preg_match('/\* @version \$Id:.+\$$/', $hunk['a'][0]) && preg_match('/\* @version \$Id:.+\$$/', $hunk['d'][0]))
{
@ -1318,7 +1354,7 @@ class BBCodeDiffFormatter extends DiffFormatter
$reorder = true;
continue;
}
}*/
}/**/
// Compare the add and replace one...
$string_1 = rtrim(trim(implode('', $hunk['a'])));
@ -1349,7 +1385,7 @@ class BBCodeDiffFormatter extends DiffFormatter
{
if (isset($hunk['a']) && isset($hunk['d']))
{
/* if (sizeof($hunk['a']) == 1 && sizeof($hunk['d']) == 1)
/**/ if (sizeof($hunk['a']) == 1 && sizeof($hunk['d']) == 1)
{
if (preg_match('/\* @version \$Id:.+\$$/', $hunk['a'][0]) && preg_match('/\* @version \$Id:.+\$$/', $hunk['d'][0]))
{
@ -1358,7 +1394,7 @@ class BBCodeDiffFormatter extends DiffFormatter
$reorder = true;
continue;
}
}*/
}/**/
// Compare the add and replace one...
$string_1 = rtrim(trim(implode('', $hunk['a'])));
@ -1673,5 +1709,3 @@ class MODXDiffFormatter extends BBCodeDiffFormatter
{
}
}
?>