Author: ivaynberg
Date: Fri Jul 11 08:48:21 2008
New Revision: 675995

URL: http://svn.apache.org/viewvc?rev=675995&view=rev
Log:
WICKET-1728

Modified:
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.html
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.java
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java?rev=675995&r1=675994&r2=675995&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/image/resource/LocalizedImageResource.java
 Fri Jul 11 08:48:21 2008
@@ -370,13 +370,6 @@
         */
        private void loadStaticImage(final String path)
        {
-               if ((path.indexOf("..") != -1) || (path.indexOf("./") != -1) || 
(path.indexOf("/.") != -1))
-               {
-                       throw new WicketRuntimeException(
-                               "The 'src' attribute must not contain any of 
the following strings: '..', './', '/.': path=" +
-                                       path);
-               }
-
                MarkupContainer parent = 
component.findParentWithAssociatedMarkup();
                if (parent instanceof Border)
                {

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.html
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.html?rev=675995&r1=675994&r2=675995&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.html
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.html
 Fri Jul 11 08:48:21 2008
@@ -4,6 +4,11 @@
     <link rel="stylesheet" type="text/css" href="style.css"/>
 </head>
 <body>
+    <img wicket:id="logo" src="../border/test.png"/>
+    <p>
+    Wicket Brewery proudly presents...
+    </p>
+    <hr/>
     <p>
            This is tooootally the best beer you can get for under a buck.
     </p>

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.java?rev=675995&r1=675994&r2=675995&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.java
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/Home.java
 Fri Jul 11 08:48:21 2008
@@ -41,6 +41,7 @@
         */
        public Home(final PageParameters parameters)
        {
+               add(new Image("logo"));
                add(new Image("beer"));
 
                // Add a couple of links to be able to play around with the 
session

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java?rev=675995&r1=675994&r2=675995&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/image/ImageTest.java
 Fri Jul 11 08:48:21 2008
@@ -62,4 +62,10 @@
                tester.clickLink("goUS");
                
tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/Beer.gif\"");
        }
+
+    public void testParentRelativeImage()
+    {
+      tester.startPage(Home.class);
+      
tester.assertContains("src=\"resources/org.apache.wicket.markup.html.image.Home/[$]up[$]/border/test.png\"");
+    }
 }


Reply via email to