mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-253651 [ssr] disable all script constraints for untrusted projects
(cherry picked from commit bfc7e228412484b7a7c2d97a6060eab483597676) IJ-CR-221143 GitOrigin-RevId: 389c925c3d03d680a82daa719dd80256e2c8d4ee
This commit is contained in:
committed by
intellij-monorepo-bot
parent
77efa286a4
commit
9f6c162fc3
@@ -274,7 +274,8 @@ error.bad.character.literal=Bad character literal
|
||||
error.bad.literal=Bad literal
|
||||
error.pattern.recursively.references.itself=Template recursively references itself
|
||||
error.configuration.0.not.found=Template ''{0}'' not found
|
||||
error.script.constraint.for.0.has.problem.1=Script constraint for {0} has problem {1}
|
||||
error.script.constraint.for.0.has.problem.1=The script constraint for the variable {0} has a problem: {1}
|
||||
error.scripts.untrusted=Scripts will not be executed because the project is not trusted
|
||||
error.groovy.script.engine.not.available=Groovy script engine is not available
|
||||
error.in.groovy.parser=Error in Groovy parser
|
||||
|
||||
|
||||
+5
-1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.structuralsearch.impl.matcher.predicates;
|
||||
|
||||
import com.intellij.ide.trustedProjects.TrustedProjects;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -105,6 +106,9 @@ public final class ScriptSupport {
|
||||
@NotNull String scriptText,
|
||||
@NotNull MatchOptions matchOptions
|
||||
) throws MalformedPatternException {
|
||||
if (!TrustedProjects.isProjectTrusted(project)) {
|
||||
throw new MalformedPatternException(SSRBundle.message("error.scripts.untrusted"));
|
||||
}
|
||||
final List<StructuralSearchScriptEngine> engines = StructuralSearchScriptEngine.EP_NAME.getExtensionList();
|
||||
if (engines.isEmpty()) {
|
||||
throw new MalformedPatternException(SSRBundle.message("error.groovy.script.engine.not.available"));
|
||||
|
||||
Reference in New Issue
Block a user