From e517a9d5e00b978044f56996b7707b6aac1ace3e Mon Sep 17 00:00:00 2001 From: Kareila Date: Sun, 24 Mar 2024 20:00:39 -0500 Subject: [PATCH] fix cat loading error in $u->should_receive_support_notifications In my fix for #2315 I inadvertently introduced a bug, which wasn't caught until @rahaeli reported spotting the following TheSchwartz error: Can't use string ("12") as a HASH ref while "strict refs" in use at /home/dw/production/cgi-bin/LJ/Support.pm line 263. This patch should fix the problem, BUT I haven't been able to test it. --- cgi-bin/LJ/User/Permissions.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cgi-bin/LJ/User/Permissions.pm b/cgi-bin/LJ/User/Permissions.pm index 7565de4b3..f89439605 100644 --- a/cgi-bin/LJ/User/Permissions.pm +++ b/cgi-bin/LJ/User/Permissions.pm @@ -1294,8 +1294,9 @@ sub should_receive_support_notifications { return 0 unless $u->is_visible; return 0 unless $u->is_validated; return 0 unless $spcatid; - return 0 unless LJ::Support::can_read_cat( $spcatid, $u ); - return 1; + + my $cat = LJ::Support::load_cats($spcatid)->{$spcatid}; + return LJ::Support::can_read_cat( $cat, $u ); } sub support_points_count {