From 5c041bc7dba161aac565cd585170e18671ce5eba Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 13 Apr 2022 10:12:51 +1200 Subject: [PATCH] ENH PHP 8.1 compatibility --- code/AuditHook.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/AuditHook.php b/code/AuditHook.php index c04e08d..40d78bb 100644 --- a/code/AuditHook.php +++ b/code/AuditHook.php @@ -45,12 +45,12 @@ public static function bind_manipulation_capture() } // If not yet set, or its already captured, just return $type = get_class($current); - $sanitisedType = str_replace('\\', '_', $type); + $sanitisedType = str_replace('\\', '_', $type ?? ''); $file = TEMP_FOLDER . "/.cache.CLC.$sanitisedType"; $dbClass = 'AuditLoggerManipulateCapture_' . $sanitisedType; - if (!is_file($file)) { - file_put_contents($file, "owner->getResponse()->getStatusCode(); - if (substr($statusCode, 0, 1) == '4') { + if (substr($statusCode ?? '', 0, 1) == '4') { $this->logPermissionDenied($statusCode, $currentMember); } }