You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/10/06 22:28:19 UTC

svn commit: r453753 - /incubator/roller/trunk/src/org/apache/roller/pojos/WeblogEntryData.java

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);