Completed
Push — master ( 04d19a...743d3f )
by Simon
02:19
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
$toolList = array(
4
	'tparis-pcount' => '//tools.wmflabs.org/supercount/index.php?user=%DATA%&project=en.wikipedia',
5
	'luxo-contributions' => '//tools.wmflabs.org/quentinv57-tools/tools/globalcontribs.php?username=%DATA%',
6
	'guc' => '//tools.wmflabs.org/guc/?user=%DATA%',
7
	'oq-whois' => 'https://whois.domaintools.com/%DATA%',
8
	'sulutil' => '//tools.wmflabs.org/quentinv57-tools/tools/sulinfo.php?showinactivity=1&showblocks=1&username=%DATA%',
9
	'google' => 'https://www.google.com/search?q=%DATA%',
10
);
11
12
if(!isset($_GET['tool'])
13
	|| !isset($toolList[$_GET['tool']])
14
	|| !isset($_GET['data'])
15
)
16
{
17
	header("HTTP/1.1 403 Forbidden");
18
	return;
19
}
20
21
if (isset($_GET['round2'])) {
22
	echo '<script>window.location.href="' . str_replace("%DATA%", htmlentities($_GET['data'], ENT_COMPAT, 'UTF-8'), $toolList[$_GET['tool']]) . '"</script>';
0 ignored issues
show
This line exceeds maximum limit of 120 characters; contains 154 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
23
}
24
else {
25
	header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true");
26
}
27