Skip to content

Commit e482c0c

Browse files
authored
Updates
1 parent 7fd0612 commit e482c0c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

config/var/www/admin/control-panel/controllers/UptimeController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ private function calculateOverallStatus(array $monitors)
206206
case self::STATUS_UP:
207207
$upCount++;
208208
break;
209-
case self::STATUS_SEEMS_DOWN: // Seems down
210-
case self::STATUS_DOWN: // Down
209+
case self::STATUS_SEEMS_DOWN:
210+
case self::STATUS_DOWN:
211211
$downCount++;
212212
break;
213-
case self::STATUS_PAUSED: // Paused
214-
case self::STATUS_NOT_CHECKED: // Not checked yet
213+
case self::STATUS_PAUSED:
214+
case self::STATUS_NOT_CHECKED:
215215
$paused++;
216216
break;
217217
default:

scripts/functions/shared/enginescript-shared-vhost.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@ configure_cloudflare_settings() {
248248
echo "Detecting server public IP address..."
249249
SERVER_IP=$(curl -s --max-time 5 https://ipinfo.io/ip)
250250

251-
# Validate IP format
252-
if ! [[ "$SERVER_IP" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
251+
# Validate IP format (ensure each octet is within 0-255)
252+
if ! [[ "$SERVER_IP" =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ ]]; then
253253
echo "WARNING: Invalid IP from ipinfo.io (${SERVER_IP}), trying backup source..."
254254
SERVER_IP=$(curl -s --max-time 5 https://icanhazip.com)
255255
256-
# Validate backup IP
257-
if ! [[ "$SERVER_IP" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
256+
# Validate backup IP (ensure each octet is within 0-255)
257+
if ! [[ "$SERVER_IP" =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-5][0-9]|[01]?[0-9][0-9]?)$ ]]; then
258258
echo "ERROR: Could not obtain valid IP address from any source."
259259
echo "Received response: ${SERVER_IP}"
260260
echo ""

0 commit comments

Comments
 (0)