diff --git a/composer.lock b/composer.lock index f23b84ea..d65f1d30 100644 --- a/composer.lock +++ b/composer.lock @@ -9,11 +9,11 @@ "packages-dev": [ { "name": "phpstan/phpstan", - "version": "2.1.40", + "version": "2.1.46", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", - "reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a193923fc2d6325ef4e741cf3af8c3e8f54dbf25", + "reference": "a193923fc2d6325ef4e741cf3af8c3e8f54dbf25", "shasum": "" }, "require": { @@ -58,7 +58,7 @@ "type": "github" } ], - "time": "2026-02-23T15:04:35+00:00" + "time": "2026-04-01T09:25:14+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -275,5 +275,5 @@ "ext-tokenizer": "*", "ext-xmlwriter": "*" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/xExtension-WordHighlighter/extension.php b/xExtension-WordHighlighter/extension.php index f6203f2c..3c56d5d7 100644 --- a/xExtension-WordHighlighter/extension.php +++ b/xExtension-WordHighlighter/extension.php @@ -63,7 +63,7 @@ public function handleConfigureAction(): void { 'enable_logs' => $this->enable_logs, 'case_sensitive' => $this->case_sensitive, 'separate_word_search' => $this->separate_word_search, - 'words' => preg_split("/\r\n|\n|\r/", $configWordList), + 'words' => preg_split("/\r\n|\n|\r/", $configWordList) ?: [], ]; $configJson = json_encode($configObj, WordHighlighterExtension::JSON_ENCODE_CONF); file_put_contents(join_path($staticPath, ('config.' . $current_user . '.json')), $configJson . PHP_EOL); @@ -80,7 +80,8 @@ public function handleConfigureAction(): void { $this->enable_logs = (bool) ($confJson['enable_logs'] ?? false); $this->case_sensitive = (bool) ($confJson['case_sensitive'] ?? false); $this->separate_word_search = (bool) ($confJson['separate_word_search'] ?? false); - $this->word_highlighter_conf = implode("\n", (array) ($confJson['words'] ?? [])); + $words = is_array($confJson['words']) ? array_filter($confJson['words'], static fn($word) => is_string($word)) : []; + $this->word_highlighter_conf = implode("\n", $words); } catch (Exception $exception) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch // probably nothing to do needed } diff --git a/xExtension-WordHighlighter/metadata.json b/xExtension-WordHighlighter/metadata.json index f716b5c6..277eb39f 100644 --- a/xExtension-WordHighlighter/metadata.json +++ b/xExtension-WordHighlighter/metadata.json @@ -2,7 +2,7 @@ "name": "Word highlighter", "author": "Lukas Melega", "description": "Highlight specific words", - "version": "0.0.3", + "version": "0.0.4", "entrypoint": "WordHighlighter", "type": "user" }