You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2017/08/01 10:14:42 UTC

svn commit: r1803633 - /sling/trunk/bundles/scripting/sightly/compiler/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java

Author: radu
Date: Tue Aug  1 10:14:41 2017
New Revision: 1803633

URL: http://svn.apache.org/viewvc?rev=1803633&view=rev
Log:
SLING-7024 - Sightly doesn't allow to emit style or on event attributes for data-sly-attribute

* improved logging message for the AttributePlugin

Modified:
    sling/trunk/bundles/scripting/sightly/compiler/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java

Modified: sling/trunk/bundles/scripting/sightly/compiler/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/sightly/compiler/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java?rev=1803633&r1=1803632&r2=1803633&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/sightly/compiler/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java (original)
+++ sling/trunk/bundles/scripting/sightly/compiler/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java Tue Aug  1 10:14:41 2017
@@ -62,7 +62,9 @@ public class AttributePlugin extends Abs
     public PluginInvoke invoke(Expression expression, PluginCallInfo callInfo, CompilerContext compilerContext) {
         String attributeName = decodeAttributeName(callInfo);
         if (attributeName != null && MarkupUtils.isSensitiveAttribute(attributeName)) {
-            String warningMessage = String.format("Refusing to generate attribute '%s' for security reasons.", attributeName);
+            String warningMessage = String.format("Sensible attribute (%s) detected: event attributes (on*) and the style attribute " +
+                    "cannot be generated with the data-sly-attribute block element; if you need to output a dynamic value for " +
+                    "this attribute then use an expression with an appropriate context.", attributeName);
             compilerContext.getPushStream().warn(new PushStream.StreamMessage(warningMessage, expression.getRawText()));
             return new DefaultPluginInvoke(); //no-op invocation
         }