Skip to content

Commit

Permalink
Merge pull request #181 from pentium10/master
Browse files Browse the repository at this point in the history
improving code by applying filter_input for sanitization
  • Loading branch information
pentium10 authored Feb 4, 2022
2 parents 95d5808 + 6ca48e9 commit 0f1ec60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions lib/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ function autoload_class($class) {
require_once dirname(__FILE__) . '/../config.php';
require_once dirname(__FILE__) . '/../src/Storage.php';

$GLOBALS['server'] = !empty($_GET['server']) ? $_GET['server'] : '';
$GLOBALS['action'] = !empty($_GET['action']) ? $_GET['action'] : '';
$GLOBALS['state'] = !empty($_GET['state']) ? $_GET['state'] : '';
$GLOBALS['count'] = !empty($_GET['count']) ? $_GET['count'] : '';
$GLOBALS['tube'] = !empty($_GET['tube']) ? $_GET['tube'] : '';
$GLOBALS['tplMain'] = !empty($_GET['tplMain']) ? $_GET['tplMain'] : '';
$GLOBALS['tplBlock'] = !empty($_GET['tplBlock']) ? $_GET['tplBlock'] : '';
$GLOBALS['server'] = !empty($_GET['server']) ? filter_input(INPUT_GET, 'server', FILTER_SANITIZE_SPECIAL_CHARS) : '';
$GLOBALS['action'] = !empty($_GET['action']) ? filter_input(INPUT_GET, 'action', FILTER_SANITIZE_SPECIAL_CHARS) : '';
$GLOBALS['state'] = !empty($_GET['state']) ? filter_input(INPUT_GET, 'state', FILTER_SANITIZE_SPECIAL_CHARS) : '';
$GLOBALS['count'] = !empty($_GET['count']) ? filter_input(INPUT_GET, 'count', FILTER_SANITIZE_SPECIAL_CHARS) : '';
$GLOBALS['tube'] = !empty($_GET['tube']) ? filter_input(INPUT_GET, 'tube', FILTER_SANITIZE_SPECIAL_CHARS) : '';
$GLOBALS['tplMain'] = !empty($_GET['tplMain']) ? filter_input(INPUT_GET, 'tplMain', FILTER_SANITIZE_SPECIAL_CHARS) : '';
$GLOBALS['tplBlock'] = !empty($_GET['tplBlock']) ? filter_input(INPUT_GET, 'tplBlock', FILTER_SANITIZE_SPECIAL_CHARS) : '';

class Console {

Expand Down
2 changes: 1 addition & 1 deletion lib/tpl/currentTubeSearchResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class="glyphicon glyphicon-forward glyphicon-white"></i>
</table>
</div>
</div>
First <?php echo $_GET['limit']; ?> rows are displayed for each state.
First <?php echo intval($_GET['limit']); ?> rows are displayed for each state.
<br/>
<br/>
</section>
Expand Down
2 changes: 1 addition & 1 deletion lib/tpl/sampleJobsEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if (isset($isNewRecord) && $isNewRecord) {
$action = '?action=newSample';
} else {
$action = '?action=editSample&key=' . $_GET['key'];
$action = '?action=editSample&key=' . urlencode($_GET['key']);
}
?>
<form name="sampleJobsEdit" action="<?php echo $action; ?>" method="POST">
Expand Down

0 comments on commit 0f1ec60

Please sign in to comment.