IJPL-162443 idea.log may contain our source code (sensitive data) from TextWithMnemonic with plugins like CodeGPT

GitOrigin-RevId: 6b15bdde38920452be2d5eaf5ea1dd29f13b3d4b
This commit is contained in:
Pavel Porvatov
2024-10-09 10:56:07 +02:00
committed by intellij-monorepo-bot
parent b567859bee
commit 15d2581c24

View File

@@ -163,8 +163,14 @@ public final class TextWithMnemonic {
String str = text.substring(pos + 1);
Exception error = null;
if (str.isEmpty()) error = new IllegalArgumentException("unexpected mnemonic marker in " + text);
if (str.indexOf(UIUtil.MNEMONIC) >= 0) error = new IllegalArgumentException("several mnemonic markers in " + text);
// Don't write text in log to avoid possible sensitive information exposure
String errorDetails = reportInvalidMnemonics ? " in text: " + text : "";
if (str.isEmpty()) {
error = new IllegalArgumentException("unexpected mnemonic marker" + errorDetails);
}
if (str.indexOf(UIUtil.MNEMONIC) >= 0) {
error = new IllegalArgumentException("several mnemonic markers" + errorDetails);
}
if (error != null) {
if (reportInvalidMnemonics) {