htdocs: remove trailing spaces

This commit is contained in:
XhmikosR 2012-09-24 22:40:00 +03:00 committed by Daniel Marjamäki
parent cc0b8fe78d
commit a7794fd274
2 changed files with 19 additions and 19 deletions

View File

@ -1,7 +1,7 @@
<?php
$isCodePosted = isset($_POST['code']) && !empty($_POST['code']);
$isXmlOutput = isset($_POST['xml']) && $_POST['xml'] == '1';
/**
* ...
* @param string $code Source code
@ -13,7 +13,7 @@
'code' => $code
)
);
$opts = array('http' =>
array(
'method' => 'POST',
@ -21,37 +21,37 @@
'content' => $postdata
)
);
$context = stream_context_create($opts);
return @file_get_contents('http://cppcheck.sourceforge.net/cgi-bin/democlient.cgi', false, $context);
}
function cut_string($string, $length = 1024) {
if (strlen($string) > $length) {
return substr($string, 0, $length);
}
return $string;
}
//--------------------------------------------------------------------------------
// XML output...
//--------------------------------------------------------------------------------
if ($isXmlOutput) { //if XML output...
header('Content-Type: text/xml');
if (!$isCodePosted) { //if NO code posted...
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results></results>\n";
exit;
}
$output = get_democlient_output(cut_string($_POST['code']));
if ($output === false) { //if NO demo client output...
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results></results>\n";
exit;
}
echo $output;
exit;
}
@ -121,28 +121,28 @@
return array();
}
}
if ($isCodePosted) { //if code posted...
include_once '../../site/geshi/geshi.php';
$code = cut_string($_POST['code']);
$geshi = new GeSHi($code, 'cpp');
$geshi->enable_classes();
$geshi->set_header_type(GESHI_HEADER_PRE_TABLE);
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$geshi->set_overall_class('geshicode');
echo "<h3>Input</h3>\n";
echo $geshi->parse_code();
echo "<h3>Output</h3>\n";
$output = get_democlient_output($code);
if (!$output === false) {
$results = parse_democlient_output($output);
if (!empty($results)) {
echo "<table id=\"resultsTable\">\n";
echo "<thead>\n";

View File

@ -115,7 +115,7 @@ add Cppcheck as an external tool.</p>
<p>You are welcome to contribute. Help is needed.</p>
<dl>
<dt>Testing</dt>
<dd>Pick a project and test it's source with latest version. Write tickets to
<dd>Pick a project and test it's source with latest version. Write tickets to
<a href="http://sourceforge.net/apps/trac/cppcheck/">Trac</a> about issues you
find from Cppcheck. If you test open source projects and write bug reports to
them, check the issues in the <a href="http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Found_bugs">Found bugs</a>