|
<?php
/* this is an easier version tracking tool */ include "reserved/VERSIONS.inc";
/* common functions and defines needed by this page */ include "reserved/misc.inc";
?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>The GNU Netcat -- Official homepage -- Website source</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="nc, netcat, network, networking, connect, listen, tunnel, tcp, udp, ipv6"> <meta name="Author" content="Giovanni Giacobbi"> <link rel="stylesheet" type="text/css" href="/netcat.css"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="icon" type="image/png" href="/favicon.ico"> </head>
<body bgcolor="#ffffff">
<?php
// No file param specified if (!isset($_GET['url'])) { print "<h1>No page URL specified</h1>\n"; print "</div>\n"; exit(); }
/* include the common parts of the web site */ include "reserved/header.inc";
//include "reserved/navbar.inc"; exit();
?> <!-- Main Body -->
<div align="center"><h1>Source of: <?= htmlentities($_GET['url']) ?></h1></div>
<table border="1" cellspacing="0" cellpadding="3" style="margin-right: 3px;"> <tr> <td> <!-- Reset indent, backup=3 -->
<?php
// Get dirname of the specified URL part $dir = dirname($_GET['url']);
// Fix SourceForge environment $_SERVER['DOCUMENT_ROOT'] = dirname($_SERVER['SCRIPT_FILENAME']);
// Some dir was present in the filename if (!empty($dir) && !preg_match("!^(\\.|/)$!", $dir)) {
// Check if the specified dir is valid $legal_dirs = array( "/reserved" => 1 ); if ((isset($legal_dirs[$dir])) && strpos($dir, "..") === FALSE) { $page_name = $_SERVER['DOCUMENT_ROOT'] . $_GET['url']; } else { $page_name = FALSE; } } else { $page_name = $_SERVER['DOCUMENT_ROOT'] . '/' . basename($_GET['url']); }
// Provide some feedback based on the file found if (!$page_name || @is_dir($page_name)) { print "<p>Invalid file or folder specified</p>\n"; } elseif (file_exists($page_name)) { highlight_php(join("", file($page_name))); } else { print "<p>This file does not exist.</p>\n"; }
?>
<!-- Restore indent, backup=0 --> </td> </tr> </table>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="500"> <tr> <td width="10"></td> <td width="470" colspan="2" class="simpletext">You may also be interested in the following files, which complete the Netcat website:<br> <ul> <li><a href="/source.php?url=/reserved/header.inc">header.inc</a><br> <li><a href="/source.php?url=/reserved/navbar.inc">navbar.inc</a><br> <li><a href="/source.php?url=/reserved/misc.inc">misc.inc</a><br> <li><a href="/source.php?url=/reserved/VERSIONS.inc">VERSIONS.inc</a><br> <li><a href="/source.php?url=/reserved/NEWS.inc">NEWS.inc</a><br> </ul>
<br> <hr width="70%" align="center">
</td> <td width="10"></td> </tr> </table>
<?php
/* include the navigation bar with the latest release info */ include "reserved/navbar.inc";
?>
</body> </html>
|