Mobile responsiveness + IP allow list comments
Mobile improvements: - Fix overflow issues with global max-width/overflow-x hidden - Stack ticket detail selects on mobile instead of one long row - Compact header: hide less important buttons, scrollable right side - Stat cards in 2-column grid on mobile - Force flex-wrap on inline-styled flex containers - Hide subtitle and user-info on small phones - Ticket selects full-width on small phones IP allow list: - Support # comments after IP addresses (e.g. "192.168.1.1 # Office VPN") - Updated placeholder with comment examples Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
9
api.php
9
api.php
@@ -162,7 +162,14 @@ function getClientIp(): string {
|
||||
function isIpAllowed(string $ip, string $allowedIps): bool {
|
||||
$allowedIps = trim($allowedIps);
|
||||
if ($allowedIps === '' || strtolower($allowedIps) === 'kaikki') return true;
|
||||
$entries = preg_split('/[\s,]+/', $allowedIps, -1, PREG_SPLIT_NO_EMPTY);
|
||||
// Tukee kommentteja: "192.168.1.1 # Yritys VPN" — risuaidan jälkeinen osa ohitetaan
|
||||
$lines = preg_split('/\r?\n/', $allowedIps);
|
||||
$entries = [];
|
||||
foreach ($lines as $line) {
|
||||
$line = preg_replace('/#.*$/', '', $line); // Poista kommentti
|
||||
$parts = preg_split('/[\s,]+/', trim($line), -1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($parts as $p) $entries[] = $p;
|
||||
}
|
||||
|
||||
// Normalisoi IP: IPv4-mapped IPv6 (::ffff:1.2.3.4) → myös IPv4 muotoon
|
||||
$ipBin = @inet_pton($ip);
|
||||
|
||||
Reference in New Issue
Block a user