Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-10-14 00:10:52 +0000
committerSteffen Pingel2011-10-14 00:10:52 +0000
commit406e77192a6aac6e9df7f0437f09b8f9475be5ab (patch)
tree89af8d619e6175d16bb78b6d25f7f56a2091d97b /org.eclipse.mylyn.trac.core
parent734eb4cb489f54feade38091a3248ee7818a9db5 (diff)
downloadorg.eclipse.mylyn.tasks-406e77192a6aac6e9df7f0437f09b8f9475be5ab.tar.gz
org.eclipse.mylyn.tasks-406e77192a6aac6e9df7f0437f09b8f9475be5ab.tar.xz
org.eclipse.mylyn.tasks-406e77192a6aac6e9df7f0437f09b8f9475be5ab.zip
NEW - bug 162094: [upstream] query by milestone returns no result when
milestone name includes ampersand https://bugs.eclipse.org/bugs/show_bug.cgi?id=162094
Diffstat (limited to 'org.eclipse.mylyn.trac.core')
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java
index 867266e45..a9ba64892 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java
@@ -122,7 +122,7 @@ public class TracSearch {
sb.append("="); //$NON-NLS-1$
List<String> values = filter.getValues();
for (Iterator<String> it = values.iterator(); it.hasNext();) {
- sb.append(it.next());
+ sb.append(escapeValue(it.next()));
if (it.hasNext()) {
sb.append("|"); //$NON-NLS-1$
}
@@ -131,6 +131,12 @@ public class TracSearch {
return sb.toString();
}
+ private String escapeValue(String text) {
+ text = text.replaceAll("&", "\\\\&"); //$NON-NLS-1$ //$NON-NLS-2$
+ text = text.replaceAll("\\|", "\\\\|"); //$NON-NLS-1$ //$NON-NLS-2$
+ return text;
+ }
+
/**
* Returns a URL encoded string that can be passed as an argument to the Trac query script.
*

Back to the top