fix(ns): class_exists() must use FQCN after PSR-4

Bare class_exists('Balance') looks up global Balance, always false
under AKSRT\* namespaces → REST 403 on balance exchange and friends.
Rewrite string checks to AKSRT\{Domain}\{Class}.
This commit is contained in:
kate522 committed 2026-07-17 15:40:20 +08:00
1 parent d55d1c6b62
commit 68d2e78d77
40 files changed
+105 -105

No files matched your search

+4 -4
View File
@@ -572,7 +572,7 @@ class PlateFollowPay {
}
private function is_follow_pay_enabled(int $plate_id): bool {
if (class_exists('Forum') && method_exists('Forum', 'is_plate_follow_pay_enabled')) {
if (class_exists('AKSRT\\Forum\\Forum') && method_exists('AKSRT\\Forum\\Forum', 'is_plate_follow_pay_enabled')) {
return (bool) Forum::get_instance()->is_plate_follow_pay_enabled($plate_id);
}
return (int) get_post_meta($plate_id, '_aksrt_follow_pay', true) === 1;
@@ -582,7 +582,7 @@ class PlateFollowPay {
* @return array{amount:float,modo:string,is_vip_price:bool,is_free:bool,label:string,base:float,vip_level:int}
*/
private function resolve_price(int $plate_id, int $user_id): array {
if (class_exists('Forum') && method_exists('Forum', 'resolve_plate_follow_pay_price')) {
if (class_exists('AKSRT\\Forum\\Forum') && method_exists('AKSRT\\Forum\\Forum', 'resolve_plate_follow_pay_price')) {
return Forum::get_instance()->resolve_plate_follow_pay_price($plate_id, $user_id);
}
return [
@@ -604,7 +604,7 @@ class PlateFollowPay {
return function_exists('aksrt_guest_has_plate_follow_access')
&& aksrt_guest_has_plate_follow_access($plate_id);
}
if (class_exists('Forum') && method_exists('Forum', 'is_user_following_plate')) {
if (class_exists('AKSRT\\Forum\\Forum') && method_exists('AKSRT\\Forum\\Forum', 'is_user_following_plate')) {
return (bool) Forum::get_instance()->is_user_following_plate($user_id, $plate_id);
}
$follow_list = get_user_meta($user_id, 'aksrt_follow_plate', true);
@@ -615,7 +615,7 @@ class PlateFollowPay {
}
private function mark_followed(int $user_id, int $plate_id): void {
if (class_exists('Forum') && method_exists('Forum', 'mark_plate_followed')) {
if (class_exists('AKSRT\\Forum\\Forum') && method_exists('AKSRT\\Forum\\Forum', 'mark_plate_followed')) {
Forum::get_instance()->mark_plate_followed($user_id, $plate_id);
return;
}