portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r833030 - /portals/applications/gems/trunk/src/main/java/org/apache/portals/gems/webwidget/WebWidgetIFramePortlet.java
Date Thu, 05 Nov 2009 11:09:49 GMT
Author: woonsan
Date: Thu Nov  5 11:09:39 2009
New Revision: 833030

URL: http://svn.apache.org/viewvc?rev=833030&view=rev
Log:
APA-21: checks if the widget source starts with "<" or not to detect the widget source
is a direct iframe src or not.

Modified:
    portals/applications/gems/trunk/src/main/java/org/apache/portals/gems/webwidget/WebWidgetIFramePortlet.java

Modified: portals/applications/gems/trunk/src/main/java/org/apache/portals/gems/webwidget/WebWidgetIFramePortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/gems/trunk/src/main/java/org/apache/portals/gems/webwidget/WebWidgetIFramePortlet.java?rev=833030&r1=833029&r2=833030&view=diff
==============================================================================
--- portals/applications/gems/trunk/src/main/java/org/apache/portals/gems/webwidget/WebWidgetIFramePortlet.java
(original)
+++ portals/applications/gems/trunk/src/main/java/org/apache/portals/gems/webwidget/WebWidgetIFramePortlet.java
Thu Nov  5 11:09:39 2009
@@ -197,7 +197,8 @@
         content.append("<IFRAME");
         
         // IFrame source can be a portlet resource url or a simple direct url.
-        // In the former case, the serveResource() method will write the widget source.
+        // In the former case, the serveResource() method will write the widget source
+        // which are normally starting with '<' for "<script ...", "<object ...",
"<iframe ..." or "<embed ...".
         // (the resource url is invoked from the generated IFrame.)
         // In the latter case, the direct url will serve the widget directly.
         String source = response.createResourceURL().toString();
@@ -205,7 +206,8 @@
         if (!StringUtils.isBlank(widgetSource))
         {
             String trimmedWidgetSource = widgetSource.trim();
-            if (!StringUtils.startsWithIgnoreCase(trimmedWidgetSource, "<script ") &&
!StringUtils.startsWithIgnoreCase(trimmedWidgetSource, "<iframe "))
+            // if the widget source does not start with '<', then it is regarded as a
direct source url of this iframe.
+            if (!trimmedWidgetSource.startsWith("<"))
             {
                 source = trimmedWidgetSource;
             }



Mime
View raw message