microsoft / referencesource

Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
https://referencesource.microsoft.com/
MIT License
3.16k stars 1.27k forks source link

Obscenity filter artifacts #68

Open yallie opened 6 years ago

yallie commented 6 years ago

EnglishPluralizationService.cs suffers from buggy obscenity filter:

https://github.com/Microsoft/referencesource/blob/7f0c570e24e6f0084b3c5794e1a50de9fbe00ca4/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs#L43

https://github.com/Microsoft/referencesource/blob/7f0c570e24e6f0084b3c5794e1a50de9fbe00ca4/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs#L50

https://github.com/Microsoft/referencesource/blob/7f0c570e24e6f0084b3c5794e1a50de9fbe00ca4/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/EnglishPluralizationService.cs#L199

First, the filter suffers from the clbuttic mistake: it doesn't take into account the word boundaries. Second, processing string constants makes no sense because it obviously breaks the code.