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/07 01:20:27 UTC
svn commit: r453806 -
/incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java
Author: snoopdave
Date: Fri Oct 6 16:20:26 2006
New Revision: 453806
URL: http://svn.apache.org/viewvc?view=rev&rev=453806
Log:
Fixes non standard characters in the Title field on a new entry results in an Unexpected exception (ROL-1128)
Modified:
incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java
Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java?view=diff&rev=453806&r1=453805&r2=453806
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/pojos/WeblogEntryData.java Fri Oct 6 16:20:26 2006
@@ -955,13 +955,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);