-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlint_php_test.php
More file actions
executable file
·112 lines (94 loc) · 2.91 KB
/
Copy pathlint_php_test.php
File metadata and controls
executable file
·112 lines (94 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<option <?php if ($themeselect=="themes//") print "selected=\"selected\""; ?>><?php print $pgv_lang["other_theme"]; ?></option>
</select>
<option type="text" value="<?php print $NTHEME_DIR; ?>" tabindex="<?php $i++; print $i; ?>" />
<?php
/* commento */ function GetGEDFromZIP($zipfile, $extract=true) {
if (!empty($gedcom_title)) $gedarray["title"] = $gedcom_title;
else if (!empty($_POST["gedcom_title"])) $gedarray["title"] = $_POST["gedcom_title"];
else $gedarray["title"] = str_replace("#GEDCOMFILE#", $GEDFILENAME, $pgv_lang["new_gedcom_title"]);
if (!$slpos) $slpos = strrpos($zipfile,"\\");
if ($slpos) $path = substr($zipfile, 0, $slpos+1);
else $path = $INDEX_DIRECTORY;
if (isset($_REQUEST['action'])) $action = $_REQUEST['action'];
if (isset($_REQUEST['action'])) $action = $_REQUEST['action']; elseif ($zipfile==2) $action = 2;
if (isset($_REQUEST['action'])) {$action = $_REQUEST['action'];} else {$action = 2;}
if (isset($_REQUEST['action']))
{$action = $_REQUEST['action'];} else {$action = 2;}
if (empty($extract)) $action = "";
}
function test2($zipfile=null, &$extract=true) {
$a=($zipfile>2)?$extract:2;
;
;;;
$i = 1;
}
function test3(/* comment 1 */ $zipfile, /* comment 2 */ $extract=true) {
$str1 = "\\ \" \' \\ ";
$str2 = ' \" \' \\ ';
$str3 = ' \" \' \\ ';
$str4 = "ciao
ciao2".strlen("ciao
ciao2");
echo "ciao
ciao2
";
print<<<END_____JSRPC__JSRPC__JSRPC__JSRPC__JSRPC__JSRPC_____END
// JS-RPC response
if (1) {captcha_rpc = 0;}
END_____JSRPC__JSRPC__JSRPC__JSRPC__JSRPC__JSRPC_____END;
}
function test4()
{
print "</b></a><br /><br />";
?>
<?php if ($source!="replace_form") { ?>
<script language="javascript" type="text/javascript">
/*Java Script*/ function getFirstElementsByTagName(node, tag){
if (!node || !tag || !node.childNodes) {}
}
</script>
<?php
}
}
// while cycle outside function definitions
while ($i <= 10) echo $i++;
function test5()
{
while ($i <= 10) {
echo $i++; /* the printed value would be
$i before the increment
(post-increment) */
}
do {
echo $i++; /* the printed value would be
$i before the increment
(post-increment) */
} while ($i <= 10);
while ($i <= 10) echo $i++;
}
function test6($i)
{
// the following line counts +3: 1 for the if, 2 for the && and || (logical operators)
if(!((edges >> edge) && 0x1 || $i)) continue;
/* the following is a bitwise operator, so the following line should only count +1 because of the if,
but not +2 because of the & and | (bitwise operators)
*/
if(!((edges >> edge) & 0x1 | $i)) continue;
}
echo "Test file is valid PHP code!";
$a = foo();
function $output_var = foo()
{ disp('hello');
$output_var_mistype = '';
}
class MyClass
{
private static $impl;
private function __construct() { }
public static function getInstance()
{
self::$impl = new MyClass();
}
}
MyClass::getInstance();
?>