roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ganes...@apache.org
Subject svn commit: r768474 - /roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
Date Sat, 25 Apr 2009 05:56:07 GMT
Author: ganeshmb
Date: Sat Apr 25 05:56:06 2009
New Revision: 768474

URL: http://svn.apache.org/viewvc?rev=768474&view=rev
Log: (empty)

Modified:
    roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java

Modified: roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java?rev=768474&r1=768473&r2=768474&view=diff
==============================================================================
--- roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
(original)
+++ roller/branches/roller_mediablogging/apps/weblogger/src/java/org/apache/roller/weblogger/business/MediaFileManagerImpl.java
Sat Apr 25 05:56:06 2009
@@ -263,8 +263,13 @@
         whereClause.append("m.directory.weblog = ?" + size);
         
         if (!StringUtils.isEmpty(filter.getName())) {
-        	params.add(size ++, filter.getName());
-        	whereClause.append(" AND m.name = ?" + size);
+        	String nameFilter = filter.getName();
+        	nameFilter = nameFilter.trim();
+        	if (!nameFilter.endsWith("%")) {
+        		nameFilter = nameFilter + "%";
+        	}
+        	params.add(size ++, nameFilter);
+        	whereClause.append(" AND m.name like ?" + size);
         }
 
         if (filter.getSize() > 0) {



Mime
View raw message