Skip to content

Commit

Permalink
Remove the pipe from the shell prepare
Browse files Browse the repository at this point in the history
Add a session variable for UI usage
  • Loading branch information
austinwbest committed Aug 29, 2024
1 parent 23df366 commit c091e4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions root/app/www/public/ajax/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
define('ABSOLUTE_PATH', '../../');
}
require ABSOLUTE_PATH . 'loader.php';

if (!$_SESSION['IN_DOCKWATCH']) {
http_response_code(400);
exit('Error: You should use the UI, its much prettier.');
}
4 changes: 2 additions & 2 deletions root/app/www/public/classes/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
----------------------------------
------ Created: 042124 ------
------ Created: 082624 ------
------ Austin Best ------
----------------------------------
*/
Expand All @@ -26,7 +26,7 @@ public function exec($cmd)

public function prepare($arg)
{
$prepared = preg_replace("/[^A-Za-z0-9 -|_]/", '', $arg);
$prepared = preg_replace("/[^A-Za-z0-9 -_]/", '', $arg);

return $prepared;
}
Expand Down
2 changes: 2 additions & 0 deletions root/app/www/public/includes/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
----------------------------------
*/

$_SESSION['IN_DOCKWATCH'] = true;

$fetchServers = false;
if (!$_SESSION['serverList'] || ($_SESSION['serverListUpdated'] + 300) < time()) {
$fetchServers = true;
Expand Down

0 comments on commit c091e4c

Please sign in to comment.