roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r463109 - in /incubator/roller/trunk: src/org/apache/roller/ui/rendering/util/WeblogFeedRequest.java src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java web/WEB-INF/classes/roller.properties
Date Thu, 12 Oct 2006 02:13:04 GMT
Author: eliast
Date: Wed Oct 11 19:13:02 2006
New Revision: 463109

URL: http://svn.apache.org/viewvc?view=rev&rev=463109
Log:
- Added configuration property for max intersection size of tags in URL requests, defaults
to 3.

Modified:
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedRequest.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java
    incubator/roller/trunk/web/WEB-INF/classes/roller.properties

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedRequest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedRequest.java?view=diff&rev=463109&r1=463108&r2=463109
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedRequest.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedRequest.java
Wed Oct 11 19:13:02 2006
@@ -28,6 +28,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
+import org.apache.roller.config.RollerConfig;
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.WeblogManager;
 import org.apache.roller.pojos.WeblogCategoryData;
@@ -132,8 +133,9 @@
         
         if(request.getParameter("tags") != null) {
           this.tags = Arrays.asList(StringUtils.split(URLUtilities.decode(request.getParameter("tags")),"+"));
-          if(this.tags.size() > 3)
-              throw new InvalidRequestException("max number of tags allowed is 3, " + request.getRequestURL());
         
+          int maxSize = RollerConfig.getIntProperty("tags.queries.maxIntersectionSize", 3);
                 
+          if(this.tags.size() > maxSize)
+              throw new InvalidRequestException("max number of tags allowed is " + maxSize
+ ", " + request.getRequestURL());
         }        
         
         if(request.getParameter("excerpts") != null) {

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java?view=diff&rev=463109&r1=463108&r2=463109
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageRequest.java
Wed Oct 11 19:13:02 2006
@@ -28,6 +28,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
+import org.apache.roller.config.RollerConfig;
+import org.apache.roller.model.PropertiesManager;
+import org.apache.roller.model.Roller;
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.UserManager;
 import org.apache.roller.model.WeblogManager;
@@ -145,8 +148,10 @@
 
                 } else if("tags".equals(this.context)) {
                   this.tags = Arrays.asList(StringUtils.split(pathElements[1],"+"));
-                  if(this.tags.size() > 3)
-                      throw new InvalidRequestException("max number of tags allowed is 3,
" + request.getRequestURL());
+                  
+                  int maxSize = RollerConfig.getIntProperty("tags.queries.maxIntersectionSize",
3);                  
+                  if(this.tags.size() > maxSize)
+                      throw new InvalidRequestException("max number of tags allowed is "
+ maxSize + ", " + request.getRequestURL());
                                       
                 } else {
                     throw new InvalidRequestException("context "+this.context+

Modified: incubator/roller/trunk/web/WEB-INF/classes/roller.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/WEB-INF/classes/roller.properties?view=diff&rev=463109&r1=463108&r2=463109
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/classes/roller.properties (original)
+++ incubator/roller/trunk/web/WEB-INF/classes/roller.properties Wed Oct 11 19:13:02 2006
@@ -453,6 +453,9 @@
 debug.memory.enabled=false
 compression.gzipResponse.enabled=true
 
+# specifies the max number of tags allowed in URL ( /feed?tags=foo+bar+baz )
+tags.queries.maxIntersectionSize=3
+
 # editor theme to be used (corresponds to directory name under /theme)
 editor.theme=tan
 



Mime
View raw message