Skip to content

Commit

Permalink
ncp-web: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Oct 4, 2017
1 parent 99126b6 commit 6e129da
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions ncp-web/ncp-launcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
// checkbox (yes/no) field
if ( preg_match('/^(\w+)_=(yes|no)$/', $line, $matches) )
{
$checked = "";
if ( $matches[2] == "yes" )
$checked = "checked";
$output = $output . "<tr>";
Expand Down
6 changes: 6 additions & 0 deletions ncp-web/ncp-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ function follow($file)
$size = 0;
while (true)
{
if ( !file_exists($file) )
{
usleep(200000); // 0.2s
continue;
}

clearstatcache();
$currentSize = filesize($file);
if ($size == $currentSize)
Expand Down
12 changes: 12 additions & 0 deletions ncp-web/wizard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
<link href="CSS/wizard.css" rel="stylesheet">
<?php
session_start();

// security headers
header("Content-Security-Policy: default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self'; object-src 'self';");
header("X-XSS-Protection: 1; mode=block");
header("X-Content-Type-Options: nosniff");
header("X-Robots-Tag: none");
header("X-Permitted-Cross-Domain-Policies: none");
header("X-Frame-Options: DENY");
header("Cache-Control: max-age=15778463");
ini_set('session.cookie_httponly', 1);
if ( isset($_SERVER['HTTPS']) )
ini_set('session.cookie_secure', 1);
?>
</head>
<body>
Expand Down

0 comments on commit 6e129da

Please sign in to comment.