From 0c018f1daf08201ee2e25df7b9b4777dcc874bcf Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 17 Dec 2025 18:00:48 +0900 Subject: [PATCH] Update references to deprecated global function checkCSRF() --- classes/module/ModuleHandler.class.php | 4 ++-- modules/comment/comment.controller.php | 4 ++-- modules/document/document.controller.php | 4 ++-- modules/document/document.view.php | 2 +- modules/layout/layout.view.php | 2 +- modules/member/member.admin.controller.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index e0faee25e..1d8acd7fe 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -393,7 +393,7 @@ class ModuleHandler extends Handler // check CSRF for non-GET (POST, PUT, etc.) actions if(!in_array(Context::getRequestMethod(), self::$_nocsrf_methods) && Context::isInstalled()) { - if(isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->check_csrf !== 'false' && !checkCSRF()) + if(isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->check_csrf !== 'false' && !Rhymix\Framework\Security::checkCSRF()) { return self::_createErrorMessage(-1, 'msg_security_violation', 403, 'ERR_CSRF_CHECK_FAILED'); } @@ -555,7 +555,7 @@ class ModuleHandler extends Handler // check CSRF for non-GET (POST, PUT, etc.) actions if(!in_array(Context::getRequestMethod(), self::$_nocsrf_methods) && Context::isInstalled()) { - if($xml_info->action->{$this->act} && $xml_info->action->{$this->act}->check_csrf !== 'false' && !checkCSRF()) + if($xml_info->action->{$this->act} && $xml_info->action->{$this->act}->check_csrf !== 'false' && !Rhymix\Framework\Security::checkCSRF()) { return self::_createErrorMessage(-1, 'msg_security_violation', 403, 'ERR_CSRF_CHECK_FAILED'); } diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 83c854e44..2471dbc0a 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -517,7 +517,7 @@ class CommentController extends Comment */ function insertComment($obj, $manual_inserted = FALSE, $update_document = TRUE) { - if(!$manual_inserted && !checkCSRF()) + if(!$manual_inserted && !Rhymix\Framework\Security::checkCSRF()) { return new BaseObject(-1, 'msg_security_violation'); } @@ -954,7 +954,7 @@ class CommentController extends Comment */ function updateComment($obj, $skip_grant_check = FALSE, $manual_updated = FALSE) { - if(!$manual_updated && !checkCSRF()) + if(!$manual_updated && !Rhymix\Framework\Security::checkCSRF()) { return new BaseObject(-1, 'msg_security_violation'); } diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 9b3cc0618..e1c1d0027 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -607,7 +607,7 @@ class DocumentController extends Document */ function insertDocument($obj, $manual_inserted = false, $isRestore = false, $isLatest = true) { - if (!$manual_inserted && !checkCSRF()) + if (!$manual_inserted && !Rhymix\Framework\Security::checkCSRF()) { return new BaseObject(-1, 'msg_security_violation'); } @@ -974,7 +974,7 @@ class DocumentController extends Document */ function updateDocument($source_obj, $obj, $manual_updated = FALSE) { - if(!$manual_updated && !checkCSRF()) + if(!$manual_updated && !Rhymix\Framework\Security::checkCSRF()) { return new BaseObject(-1, 'msg_security_violation'); } diff --git a/modules/document/document.view.php b/modules/document/document.view.php index 415293993..1085996cb 100644 --- a/modules/document/document.view.php +++ b/modules/document/document.view.php @@ -50,7 +50,7 @@ class DocumentView extends Document */ function dispDocumentPreview() { - if(!checkCSRF()) + if(!Rhymix\Framework\Security::checkCSRF()) { throw new Rhymix\Framework\Exceptions\SecurityViolation; } diff --git a/modules/layout/layout.view.php b/modules/layout/layout.view.php index ee6e87b7c..b83713a16 100644 --- a/modules/layout/layout.view.php +++ b/modules/layout/layout.view.php @@ -320,7 +320,7 @@ class LayoutView extends Layout */ function dispLayoutPreview() { - if(!checkCSRF()) + if(!Rhymix\Framework\Security::checkCSRF()) { throw new Rhymix\Framework\Exceptions\InvalidRequest; } diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php index 1ffb3a725..1bc72fe41 100644 --- a/modules/member/member.admin.controller.php +++ b/modules/member/member.admin.controller.php @@ -24,7 +24,7 @@ class MemberAdminController extends Member // if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request"); // Extract the necessary information in advance $logged_info = Context::get('logged_info'); - if($logged_info->is_admin != 'Y' || !checkCSRF()) + if($logged_info->is_admin != 'Y' || !Rhymix\Framework\Security::checkCSRF()) { throw new Rhymix\Framework\Exceptions\InvalidRequest; }