Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH PHP 8.1 compatibility #42

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/AuditHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<?php
if (!is_file($file ?? '')) {
file_put_contents($file ?? '', "<?php
class $dbClass extends $type
{
public \$isManipulationLoggingCapture = true;
Expand Down Expand Up @@ -105,7 +105,7 @@ public static function handle_manipulation($manipulation)
}

// logging writes to specific tables (just not when logging in, as it's noise)
if (in_array($table, $watchedTables)
if (in_array($table, $watchedTables ?? [])
&& !preg_match('/Security/', @$_SERVER['REQUEST_URI'])
&& isset($details['id'])
) {
Expand Down Expand Up @@ -416,7 +416,7 @@ public function onAfterInit()

$statusCode = $this->owner->getResponse()->getStatusCode();

if (substr($statusCode, 0, 1) == '4') {
if (substr($statusCode ?? '', 0, 1) == '4') {
$this->logPermissionDenied($statusCode, $currentMember);
}
}
Expand Down