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

+3 -3
View File
@@ -576,7 +576,7 @@ class TopicPay {
* @return array{amount:float,is_vip_price:bool,is_free:bool,label:string,base:float,vip_set:bool,vip_level:int}
*/
private function resolve_price(int $topic_id, int $user_id): array {
if (class_exists('Forum')) {
if (class_exists('AKSRT\\Forum\\Forum')) {
return Forum::get_instance()->resolve_topic_pay_price($topic_id, $user_id);
}
return [
@@ -594,7 +594,7 @@ class TopicPay {
if ($user_id <= 0) {
return function_exists('aksrt_guest_has_paid_access') && aksrt_guest_has_paid_access($topic_id);
}
if (class_exists('Forum')) {
if (class_exists('AKSRT\\Forum\\Forum')) {
return Forum::get_instance()->has_user_paid_topic($user_id, $topic_id);
}
if (class_exists('\AKSRT\Payment\Order')) {
@@ -608,7 +608,7 @@ class TopicPay {
}
private function mark_unlocked(int $user_id, int $topic_id): void {
if (class_exists('Forum') && method_exists('Forum', 'mark_topic_unlocked')) {
if (class_exists('AKSRT\\Forum\\Forum') && method_exists('AKSRT\\Forum\\Forum', 'mark_topic_unlocked')) {
Forum::get_instance()->mark_topic_unlocked($user_id, $topic_id);
return;
}