roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r985008 - in /roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger: business/referrers/ReferrerProcessingJob.java pojos/WeblogReferrer.java
Date Thu, 12 Aug 2010 22:00:45 GMT
Author: snoopdave
Date: Thu Aug 12 22:00:44 2010
New Revision: 985008

URL: http://svn.apache.org/viewvc?rev=985008&view=rev
Log:
Ensure that referrer URL does not overflow and cause exception, also fixing some warnings

Modified:
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerProcessingJob.java
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerProcessingJob.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerProcessingJob.java?rev=985008&r1=985007&r2=985008&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerProcessingJob.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/referrers/ReferrerProcessingJob.java
Thu Aug 12 22:00:44 2010
@@ -23,13 +23,11 @@
 
 package org.apache.roller.weblogger.business.referrers;
 
-import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.runnable.Job;
-import org.apache.roller.weblogger.business.referrers.RefererManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 
 

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java?rev=985008&r1=985007&r2=985008&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/pojos/WeblogReferrer.java
Thu Aug 12 22:00:44 2010
@@ -60,6 +60,7 @@ public class WeblogReferrer implements S
             String excerpt, Boolean visible,
             Boolean duplicate, Integer dayHits,
             Integer totalHits) {
+        
         //this.id = id;
         this.website = website;
         this.weblogEntry = weblogEntry;
@@ -73,6 +74,10 @@ public class WeblogReferrer implements S
         this.duplicate = duplicate;
         this.dayHits = dayHits;
         this.totalHits = totalHits;
+
+        if (this.refererUrl != null && this.refererUrl.length() > 255) {
+            this.refererUrl = this.refererUrl.substring(0, 254);
+        }
     }
     
     //------------------------------------------------------- Simple properties
@@ -144,6 +149,9 @@ public class WeblogReferrer implements S
     
     public void setRefererUrl(String refererUrl) {
         this.refererUrl = refererUrl;
+        if (this.refererUrl != null && this.refererUrl.length() > 255) {
+            this.refererUrl = this.refererUrl.substring(0, 255);
+        }
     }
     
     /**



Mime
View raw message