From f6c0c9682c003bf14315ecbd1eea19c3d3fe1b63 Mon Sep 17 00:00:00 2001 From: Eren Date: Wed, 18 Feb 2026 20:44:42 +0300 Subject: [PATCH] apply escaping (#4071) --- functions/public/Invoke-WPFToggleAllCategories.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/public/Invoke-WPFToggleAllCategories.ps1 b/functions/public/Invoke-WPFToggleAllCategories.ps1 index 960a265d..6b0745d1 100644 --- a/functions/public/Invoke-WPFToggleAllCategories.ps1 +++ b/functions/public/Invoke-WPFToggleAllCategories.ps1 @@ -40,7 +40,8 @@ function Invoke-WPFToggleAllCategories { # Update the label to show the correct state $categoryLabel = $categoryContainer.Children[0] if ($categoryLabel.Content -like "$sourcePrefix*") { - $categoryLabel.Content = $categoryLabel.Content -replace "^$sourcePrefix ", "$targetPrefix " + $escapedSourcePrefix = [regex]::Escape($sourcePrefix) + $categoryLabel.Content = $categoryLabel.Content -replace "^$escapedSourcePrefix ", "$targetPrefix " } } }