abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r436849 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
Date Fri, 25 Aug 2006 16:42:25 GMT
Author: jmsnell
Date: Fri Aug 25 09:42:24 2006
New Revision: 436849

URL: http://svn.apache.org/viewvc?rev=436849&view=rev
Log:
There is no sane reason for atom:icon and atom:logo elements to use javascript or mailto
links.  Have the getLogo() and getIcon() methods return a null if either of these schemes

are used.  getLogoElement() and getIconElement() continue to work as before.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java?rev=436849&r1=436848&r2=436849&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
Fri Aug 25 09:42:24 2006
@@ -474,7 +474,9 @@
   
   public URI getIcon() throws URISyntaxException {
     IRI iri = getIconElement();
-    return (iri != null) ? iri.getResolvedValue() : null;
+    URI uri = (iri != null) ? iri.getResolvedValue() : null;
+    return (URIHelper.isJavascriptUri(uri) ||
+        URIHelper.isMailtoUri(uri)) ? null : uri;
   }
 
   public IRI getLogoElement() {
@@ -501,7 +503,9 @@
   
   public URI getLogo() throws URISyntaxException {
     IRI iri = getLogoElement();
-    return (iri != null) ? iri.getResolvedValue() : null;
+    URI uri = (iri != null) ? iri.getResolvedValue() : null;
+    return (URIHelper.isJavascriptUri(uri) ||
+        URIHelper.isMailtoUri(uri)) ? null : uri;
   }
   
   public Link getLink(String rel) {



Mime
View raw message