You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "spyhunter99 (via GitHub)" <gi...@apache.org> on 2026/06/18 00:21:38 UTC

[PR] Bug/jspwiki 1273 [jspwiki]

spyhunter99 opened a new pull request, #498:
URL: https://github.com/apache/jspwiki/pull/498

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jspwiki.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Bug/jspwiki 1273 [jspwiki]

Posted by "juanpablo-santos (via GitHub)" <gi...@apache.org>.
juanpablo-santos commented on code in PR #498:
URL: https://github.com/apache/jspwiki/pull/498#discussion_r3458481603


##########
jspwiki-main/src/test/java/org/apache/wiki/plugin/ImageTest.java:
##########
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2026 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wiki.plugin;
+
+import org.apache.wiki.TestEngine;
+import org.apache.wiki.render.RenderingManager;
+import org.junit.jupiter.api.Assertions;
+
+/**
+ *
+ */
+public class ImageTest {
+
+    static TestEngine testEngine = TestEngine.build();
+
+    /**
+     * Test of execute method, of class Image.
+     */
+    @org.junit.jupiter.api.Test

Review Comment:
   minor nitpick: import the class so it can be referenced as `@Test`



##########
jspwiki-main/src/main/java/org/apache/wiki/plugin/Image.java:
##########
@@ -200,8 +203,11 @@ public String execute( final Context context, final Map<String, String> params )
             result.append(">");
         }
 
-        if( !context.getBooleanWikiProperty( MarkupParser.PROP_ALLOWHTML, false ) ) {
-            if( src.startsWith( "data:" ) || src.startsWith( "javascript:" ) ) {
+        if(!context.getBooleanWikiProperty(MarkupParser.PROP_ALLOWHTML, false)) {
+            String testVal = src.toLowerCase().replaceAll("\\s+", "").trim();

Review Comment:
   perhaps extract this to a method in TextUtil in case we end up needing it in other places?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jspwiki.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Bug/jspwiki 1273 [jspwiki]

Posted by "spyhunter99 (via GitHub)" <gi...@apache.org>.
spyhunter99 merged PR #498:
URL: https://github.com/apache/jspwiki/pull/498


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jspwiki.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org