Skip to content
Open
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
2 changes: 1 addition & 1 deletion auth/oidc/classes/event/action_failed.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function get_name() {
* @return string
*/
public function get_description() {
return $this->data['other'];
return json_encode($this->data['other']);
Copy link

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding JSON_THROW_ON_ERROR (e.g., json_encode(..., JSON_THROW_ON_ERROR)) to catch encoding failures explicitly instead of returning false on error.

Suggested change
return json_encode($this->data['other']);
try {
return json_encode($this->data['other'], JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
// Log the error or handle it appropriately.
error_log('JSON encoding error: ' . $e->getMessage());
return '{}'; // Return an empty JSON object as a fallback.
}

Copilot uses AI. Check for mistakes.

}

/**
Expand Down