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.

While wrapping $this->data['other'] with json_encode fixes the data type issue, consider adding error handling for json_encode failure cases to prevent unexpected behavior if encoding fails.

Suggested change
return json_encode($this->data['other']);
$json = json_encode($this->data['other']);
if ($json === false) {
// Log the error and return a fallback value.
debugging('Failed to encode $this->data["other"] to JSON: ' . json_last_error_msg(), DEBUG_DEVELOPER);
return '{"error": "Failed to encode data"}';
}
return $json;

Copilot uses AI. Check for mistakes.
}

/**
Expand Down