Skip to content

Commit

Permalink
Fix warning in main.php for PHP 8+ (#1014)
Browse files Browse the repository at this point in the history
* Fix PHP Warning in main.php for PHP 8+


```
PHP Warning:  Undefined array key "REMOTE_USER" in /usr/local/nagios/share/main.php on line 29
```

* Update html/main.php

props @tsadpbb

Co-authored-by: tsadpbb <[email protected]>

* Update main.php

Missed a parenthesis. :)

---------

Co-authored-by: tsadpbb <[email protected]>
  • Loading branch information
aidvu and tsadpbb authored Dec 16, 2024
1 parent 9753a1d commit 4832ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion html/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Click here to watch the entire Nagios Core 4 Tour!</a>";
<?php } ?>
$(document).ready(function() {
var user = "<?php echo htmlspecialchars($_SERVER['REMOTE_USER']); ?>";
var user = "<?php echo htmlspecialchars($_SERVER['REMOTE_USER'] ?? ''); ?>";

<?php if ($cfg["enable_page_tour"]) { ?>
vBoxId += ";" + user;
Expand Down

0 comments on commit 4832ead

Please sign in to comment.