roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r453753 - /incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java
Date Fri, 06 Oct 2006 20:28:19 GMT
Author: snoopdave
Date: Fri Oct  6 13:28:18 2006
New Revision: 453753

URL: http://svn.apache.org/viewvc?view=rev&rev=453753
Log:
Ensure that anchor is created even even title includes non-alpha numerics (ROL-1128)

Modified:
    incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java

Modified: incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java?view=diff&rev=453753&r1=453752&r2=453753
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java Fri Oct  6 13:28:18
2006
@@ -1098,13 +1098,20 @@
     
     /** Create anchor for weblog entry, based on title or text */
     public String createAnchorBase() {
+        
         // Use title or text for base anchor
         String base = getTitle();
-        if (base == null || base.trim().equals("")) {
-            base = getText();
-        }
-        if (base != null && !base.trim().equals("")) {
+        if (base != null) {
             base = Utilities.replaceNonAlphanumeric(base, ' ');
+            if (StringUtils.isEmpty(base.trim())) {
+                base = getText();
+                if (base != null) {
+                    base = Utilities.replaceNonAlphanumeric(base, ' ');
+                }
+            }
+        }
+
+        if (StringUtils.isEmpty(base.trim())) {
             
             // Use only the first 4 words
             StringTokenizer toker = new StringTokenizer(base);



Mime
View raw message