do not use regex in sanitization

pull/4/head
Zlatin Balevsky 2019-06-04 17:46:41 +01:00
parent 6e3a2c0d08
commit bb02fdbee9
2 changed files with 7 additions and 2 deletions

View File

@ -11,5 +11,5 @@ class Constants {
public static final float DOWNLOAD_SEQUENTIAL_RATIO = 0.8f
public static final String SPLIT_PATTERN = "[\\.,_-<>:;]"
public static final String SPLIT_PATTERN = "[\\.,_-]"
}

View File

@ -14,6 +14,7 @@ import javax.swing.ListSelectionModel
import javax.swing.SwingConstants
import javax.swing.border.Border
import com.muwire.core.Constants
import com.muwire.core.download.Downloader
import com.muwire.core.files.FileSharedEvent
@ -183,7 +184,11 @@ class MainFrameView {
scrollPane(constraints : BorderLayout.CENTER) {
table(id : "searches-table") {
tableModel(list : model.searches) {
closureColumn(header : "Keywords", type : String, read : { it.search })
closureColumn(header : "Keywords", type : String, read : {
def sanitized = String.replaceAll(Constants.SPLIT_PATTERN,it.search)
sanitized = sanitized.replace("<", " ")
sanitized
})
closureColumn(header : "From", type : String, read : {
if (it.originator != null) {
return it.originator.getHumanReadableName()