From 641b89197243c67f90e8853ad2187c831050fbe7 Mon Sep 17 00:00:00 2001 From: Joe Stump Date: Fri, 10 Nov 2023 23:40:51 -0800 Subject: Fix trusted cidrs check (#5853) * Fix ignored TRUSTED_PROXY issue * Add a sub-section to the docs no property mappings for Authentik * Typo * Fix typing * A few changes to the doc --------- Co-authored-by: Alexandre Alapetite --- lib/lib_rss.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 356d5bc0d..648f11a74 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -683,10 +683,10 @@ function checkTrustedIP(): bool { if ($trusted != 0 && is_string($trusted)) { $trusted = preg_split('/\s+/', $trusted, -1, PREG_SPLIT_NO_EMPTY); } - if (empty($trusted)) { + if (!is_array($trusted) || empty($trusted)) { $trusted = FreshRSS_Context::$system_conf->trusted_sources; } - foreach (FreshRSS_Context::$system_conf->trusted_sources as $cidr) { + foreach ($trusted as $cidr) { if (checkCIDR($remoteIp, $cidr)) { return true; } -- cgit v1.2.3