Skip to content

Commit be7060f

Browse files
committed
Cleaned up and formatted code - some adjustments to selected files
The following adjustments were made: - Formate source code - Remove trailing whitespaces - Files should end with a newline (PHP:S113) - Control structures should use curly braces (PHP:S121) - Sections of code should not be commented out (PHP:S125) - Mergeable "if" statements should be combined (PHP:S1066) - Empty statements should be removed (PHP:S1116) - Modifiers should be declared in the correct order (PHP:S1124) - Boolean literals should not be redundant (PHP:S1125) - Use empty() to check whether the array is empty or not (PHP:S1155) - Unused function parameters should be removed (PHP:S1172) - Unused local variables should be removed (PHP:S1481) - Local variables should not be declared and then immediately returned or thrown (PHP:1488) - Method visibility should be explicitly declared (PHP:S1784) - The "var" keyword should not be used (PHP:S1765) - PHP keywords and constants "true", "false", "null" should be lower case (PHP:S1781) - "elseif" keyword should be used in place of "else if" keywords (PHP:S1793) - Unused assignments should be removed (PHP:S1854) - Jump statements should not be redundant (PHP:3626)
1 parent f32fef4 commit be7060f

261 files changed

Lines changed: 94192 additions & 83653 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config.inc.php

Lines changed: 2307 additions & 2245 deletions
Large diffs are not rendered by default.

error.php

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
<?php
2-
/**
3-
* TestLink Open Source Project - http://testlink.sourceforge.net/
4-
* This script is distributed under the GNU General Public License 2 or later.
5-
*
6-
* General purpose error page.
7-
*
8-
* @package TestLink
9-
* @copyright 2012,2019 TestLink community
10-
*
11-
* @internal revisions
12-
* @used by: kinow - TICKET 4977 - CSRF - Advisory ID: HTB23088
13-
*
14-
**/
15-
16-
require_once 'config.inc.php';
17-
require_once 'common.php';
18-
19-
/**
20-
* Initializes the arguments
21-
*
22-
* @return stdClass
23-
*/
24-
function init_args() {
25-
26-
$args = new stdClass();
27-
$args->message = 'Rocket Raccoon is watching You';
28-
$code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0;
29-
30-
switch($code) {
31-
case 1:
32-
$args->message = 'No CSRFName found, probable invalid request.';
33-
break;
34-
35-
case 2:
36-
$args->message = 'Invalid CSRF token';
37-
break;
38-
39-
default:
40-
break;
41-
}
42-
43-
return $args;
44-
}
45-
46-
/**
47-
* initializes the GUI
48-
*
49-
* @param stdClass $args
50-
* @return stdClass
51-
*/
52-
function init_gui($args) {
53-
$gui = new stdClass();
54-
$gui->message = '';
55-
56-
if (isset($args->message)) {
57-
$gui->message = $args->message;
58-
}
59-
60-
return $gui;
61-
}
62-
63-
$templateCfg = templateConfiguration();
64-
$args = init_args();
65-
$gui = init_gui($args);
66-
67-
$smarty = new TLSmarty();
68-
$smarty->assign('gui', $gui);
1+
<?php
2+
/**
3+
* TestLink Open Source Project - http://testlink.sourceforge.net/
4+
* This script is distributed under the GNU General Public License 2 or later.
5+
*
6+
* General purpose error page.
7+
*
8+
* @package TestLink
9+
* @copyright 2012,2019 TestLink community
10+
*
11+
* @internal revisions
12+
* @used by: kinow - TICKET 4977 - CSRF - Advisory ID: HTB23088
13+
*
14+
**/
15+
require_once 'config.inc.php';
16+
require_once 'common.php';
17+
18+
/**
19+
* Initializes the arguments
20+
*
21+
* @return stdClass
22+
*/
23+
function init_args()
24+
{
25+
$args = new stdClass();
26+
$args->message = 'Rocket Raccoon is watching You';
27+
$code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0;
28+
29+
switch ($code) {
30+
case 1:
31+
$args->message = 'No CSRFName found, probable invalid request.';
32+
break;
33+
34+
case 2:
35+
$args->message = 'Invalid CSRF token';
36+
break;
37+
38+
default:
39+
break;
40+
}
41+
42+
return $args;
43+
}
44+
45+
/**
46+
* initializes the GUI
47+
*
48+
* @param stdClass $args
49+
* @return stdClass
50+
*/
51+
function init_gui($args)
52+
{
53+
$gui = new stdClass();
54+
$gui->message = '';
55+
56+
if (isset($args->message)) {
57+
$gui->message = $args->message;
58+
}
59+
60+
return $gui;
61+
}
62+
63+
$templateCfg = templateConfiguration();
64+
$args = init_args();
65+
$gui = init_gui($args);
66+
67+
$smarty = new TLSmarty();
68+
$smarty->assign('gui', $gui);
6969
$smarty->display($templateCfg->default_template);

0 commit comments

Comments
 (0)