Skip to content

Commit

Permalink
tagged 2.2.1 from branches/2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed May 11, 2009
1 parent 0a01b8e commit ff9a9c4
Show file tree
Hide file tree
Showing 63 changed files with 3,205 additions and 3,266 deletions.
443 changes: 214 additions & 229 deletions blame.php

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions comp.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ function checkRevision($rev) {
$vars['repurl'] = $config->getURL($rep, '', 'dir');

$url = $config->getURL($rep, "/", "comp");
$vars["revlink"] = '<a href="'.$url.'compare%5B%5D='.urlencode($path2).'@'.$rev2.'&amp;compare%5B%5D='.urlencode($path1).'@'.$rev1.'&amp;manualorder=1'.($ignoreWhitespace ? '&amp;ignorews=1' : '').'">'.$lang['REVCOMP'].'</a>';
$vars["revlink"] = '<a href="'.$url.'compare%5B%5D='.urlencode($path2).'@'.$rev2.'&amp;compare%5B%5D='.urlencode($path1).'@'.$rev1.'&amp;manualorder=1&amp;ignorews='.($ignoreWhitespace ? '1' : '0').'">'.$lang['REVCOMP'].'</a>';
if (!$ignoreWhitespace) {
$vars['ignorewhitespacelink'] = '<a href="'.$url.'compare%5B%5D='.urlencode($path1).'@'.$rev1.'&amp;compare%5B%5D='.urlencode($path2).'@'.$rev2.($manualorder ? '&amp;manualorder=1' : '').'&amp;ignorews=1">'.$lang['IGNOREWHITESPACE'].'</a>';
$vars['ignorewhitespacelink'] = '<a href="'.$url.'compare%5B%5D='.urlencode($path1).'@'.$rev1.'&amp;compare%5B%5D='.urlencode($path2).'@'.$rev2.'&amp;manualorder='.($manualorder ? '1' : '0').'&amp;ignorews=1">'.$lang['IGNOREWHITESPACE'].'</a>';
$vars['regardwhitespacelink'] = '';
} else {
$vars['regardwhitespacelink'] = '<a href="'.$url.'compare%5B%5D='.urlencode($path1).'@'.$rev1.'&amp;compare%5B%5D='.urlencode($path2).'@'.$rev2.($manualorder ? '&amp;manualorder=1' : '').'">'.$lang['REGARDWHITESPACE'].'</a>';
$vars['regardwhitespacelink'] = '<a href="'.$url.'compare%5B%5D='.urlencode($path1).'@'.$rev1.'&amp;compare%5B%5D='.urlencode($path2).'@'.$rev2.'&amp;manualorder='.($manualorder ? '1' : '0').'&amp;ignorews=0">'.$lang['REGARDWHITESPACE'].'</a>';
$vars['ignorewhitespacelink'] = '';
}

Expand All @@ -104,16 +104,13 @@ function checkRevision($rev) {

$vars["repname"] = $rep->getDisplayName();
$vars["action"] = $lang["PATHCOMPARISON"];

$hidden = ($config->multiViews) ? "<input type=\"hidden\" name=\"op\" value=\"comp\" />" : "";
$hidden .= "<input type=\"hidden\" name=\"manualorder\" value=\"1\" />";
$vars["compare_form"] = "<form action=\"$url\" method=\"post\">".$hidden;
$vars["compare_form"] = "<form action=\"$url\" method=\"post\">";
$vars["compare_path1input"] = "<input type=\"text\" size=\"40\" name=\"compare[0]\" value=\"".htmlentities($path1, ENT_QUOTES, 'UTF-8')."\" />";
$vars["compare_rev1input"] = "<input type=\"text\" size=\"5\" name=\"compare_rev[0]\" value=\"$rev1\" />";
$vars["compare_path2input"] = "<input type=\"text\" size=\"40\" name=\"compare[1]\" value=\"".htmlentities($path2, ENT_QUOTES, 'UTF-8')."\" />";
$vars["compare_rev2input"] = "<input type=\"text\" size=\"5\" name=\"compare_rev[1]\" value=\"$rev2\" />";
$vars["compare_submit"] = "<input name=\"comparesubmit\" type=\"submit\" value=\"${lang["COMPAREPATHS"]}\" />";
$vars["compare_hidden"] = ""; // TODO: Remove this completely at some point
$vars["compare_hidden"] = "<input type=\"hidden\" name=\"op\" value=\"comp\" /><input type=\"hidden\" name=\"manualorder\" value=\"1\" />";
$vars["compare_endform"] = "</form>";

// safe paths are a hack for fixing XSS sploit
Expand Down Expand Up @@ -384,11 +381,12 @@ function clearVars() {
}
}

$vars["version"] = $version;

if (!$rep->hasUnrestrictedReadAccess($relativePath1) || !$rep->hasUnrestrictedReadAccess($relativePath2, false)) {
$vars["noaccess"] = true;
}

$vars["template"] = "compare";
parseTemplate($rep->getTemplatePath()."header.tmpl", $vars, $listing);
parseTemplate($rep->getTemplatePath()."compare.tmpl", $vars, $listing);
parseTemplate($rep->getTemplatePath()."footer.tmpl", $vars, $listing);
44 changes: 19 additions & 25 deletions diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
$prevrev = @$history->entries[1]->rev;
$vars["repname"] = htmlentities($rep->getDisplayName(), ENT_QUOTES, "UTF-8");
$vars["repname"] = htmlentities($rep->getDisplayName(), ENT_QUOTES, 'UTF-8');
$vars["rev"] = $rev;
$vars["path"] = htmlentities($ppath, ENT_QUOTES, "UTF-8");
$vars["path"] = htmlentities($ppath, ENT_QUOTES, 'UTF-8');
$vars["prevrev"] = $prevrev;
$vars["rev1"] = $history->entries[0]->rev;
Expand All @@ -82,13 +82,13 @@
$url = $config->getURL($rep, $path, "file");
if ($rev != $youngest) {
$vars["goyoungestlink"] = "<a href=\"${url}\">${lang["GOYOUNGEST"]}</a>";
$vars["goyoungestlink"] = '<a href="'.$url.'">'.$lang['GOYOUNGEST'].'</a>';
} else {
$vars["goyoungestlink"] = "";
}

$vars["indexurl"] = $config->getURL($rep, "", "index");
$vars["repurl"] = $config->getURL($rep, "", "dir");
$vars['indexurl'] = $config->getURL($rep, '', 'index');
$vars['repurl'] = $config->getURL($rep, '', 'dir');

$url = $config->getURL($rep, $path, "file");
$vars["filedetaillink"] = "<a href=\"${url}rev=$rev&amp;isdir=0\">${lang["FILEDETAIL"]}</a>";
Expand All @@ -102,34 +102,22 @@
$url = $config->getURL($rep, $path, "blame");
$vars["blamelink"] = "<a href=\"${url}rev=$rev\">${lang["BLAME"]}</a>";

// Check for binary file type before diffing.
$svnMimeType = $svnrep->getProperty($path, "svn:mime-type", $rev);

if (!$rep->getIgnoreSvnMimeTypes() && preg_match("~application/*~", $svnMimeType)) {
$vars["warning"] = "Cannot display diff of binary file. (svn:mime-type = $svnMimeType)";
}
// If no previous revision exists, bail out before diffing
else if (!$prevrev) {
$vars["noprev"] = 1;
$url = $config->getURL($rep, $path, "file");
$vars["filedetaillink"] = "<a href=\"${url}rev=$rev\">${lang["FILEDETAIL"]}</a>";
}
else {
if ($prevrev) {
$url = $config->getURL($rep, $path, "diff");

if (!$all) {
$vars["showalllink"] = '<a href="'.$url.'rev='.$rev.'&amp;all=1'.($ignoreWhitespace ? "&amp;ignorews=1" : "").'">'.$lang['SHOWENTIREFILE'].'</a>';
$vars["showalllink"] = '<a href="'.$url.'rev='.$rev.'&amp;all=1&amp;ignorews='.($ignoreWhitespace ? '1' : '0').'">'.$lang['SHOWENTIREFILE'].'</a>';
$vars["showcompactlink"] = '';
} else {
$vars["showcompactlink"] = '<a href="'.$url.'rev='.$rev.'&amp;all=0'.($ignoreWhitespace ? "&amp;ignorews=1" : "").'">'.$lang['SHOWCOMPACT'].'</a>';
$vars["showcompactlink"] = '<a href="'.$url.'rev='.$rev.'&amp;all=0&amp;ignorews='.($ignoreWhitespace ? '1' : '0').'">'.$lang['SHOWCOMPACT'].'</a>';
$vars["showalllink"] = '';
}
if (!$ignoreWhitespace) {
$vars["ignorewhitespacelink"] = '<a href="'.$url.'rev='.$rev.'&amp;all='.($all ? '1' : '0').'&amp;ignorews=1">'.$lang['IGNOREWHITESPACE'].'</a>';
$vars["regardwhitespacelink"] = "";
$vars['ignorewhitespacelink'] = '<a href="'.$url.'rev='.$rev.'&amp;all='.($all ? '1' : '0').'&amp;ignorews=1">'.$lang['IGNOREWHITESPACE'].'</a>';
$vars['regardwhitespacelink'] = '';
} else {
$vars["regardwhitespacelink"] = '<a href="'.$url.'rev='.$rev.($all ? '&amp;all=1' : '').'">'.$lang['REGARDWHITESPACE'].'</a>';
$vars["ignorewhitespacelink"] = "";
$vars['regardwhitespacelink'] = '<a href="'.$url.'rev='.$rev.'&amp;all='.($all ? '1' : '0').'&amp;ignorews=0">'.$lang['REGARDWHITESPACE'].'</a>';
$vars['ignorewhitespacelink'] = '';
}

// Get the contents of the two files
Expand All @@ -145,13 +133,19 @@
// Remove our temporary files
@unlink($oldtname);
@unlink($newtname);

} else {
$vars["noprev"] = 1;
$url = $config->getURL($rep, $path, "file");
$vars["filedetaillink"] = "<a href=\"${url}rev=$rev\">${lang["SHOWENTIREFILE"]}.</a>";
}

$vars["version"] = $version;

if (!$rep->hasReadAccess($path, false)) {
$vars["noaccess"] = true;
}

$vars["template"] = "diff";
parseTemplate($rep->getTemplatePath()."header.tmpl", $vars, $listing);
parseTemplate($rep->getTemplatePath()."diff.tmpl", $vars, $listing);
parseTemplate($rep->getTemplatePath()."footer.tmpl", $vars, $listing);
Loading

0 comments on commit ff9a9c4

Please sign in to comment.