apply escaping (#4071)

This commit is contained in:
Eren
2026-02-18 20:44:42 +03:00
committed by GitHub
parent b7ef73cb10
commit f6c0c9682c

View File

@@ -40,7 +40,8 @@ function Invoke-WPFToggleAllCategories {
# Update the label to show the correct state # Update the label to show the correct state
$categoryLabel = $categoryContainer.Children[0] $categoryLabel = $categoryContainer.Children[0]
if ($categoryLabel.Content -like "$sourcePrefix*") { if ($categoryLabel.Content -like "$sourcePrefix*") {
$categoryLabel.Content = $categoryLabel.Content -replace "^$sourcePrefix ", "$targetPrefix " $escapedSourcePrefix = [regex]::Escape($sourcePrefix)
$categoryLabel.Content = $categoryLabel.Content -replace "^$escapedSourcePrefix ", "$targetPrefix "
} }
} }
} }