Skip to content

Commit

Permalink
fix: try to fix "Cannot access offset '...' on mixed."
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukáš Melega committed May 22, 2024
1 parent 09c0d24 commit 1f40909
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xExtension-WordHighlighter/extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public function handleConfigureAction(): void
if (file_exists($configFileJson)) {
try {
$confJson = json_decode(file_get_contents($configFileJson) ?: '', true, 8, JSON_THROW_ON_ERROR);
if (json_last_error() !== JSON_ERROR_NONE || !is_array($confJson)) {
return;
}
$this->enable_in_article = (bool) ($confJson['enable_in_article'] ?? false);
$this->enable_logs = (bool) ($confJson['enable_logs'] ?? false);
$this->case_sensitive = (bool) ($confJson['case_sensitive'] ?? false);
Expand Down

0 comments on commit 1f40909

Please sign in to comment.