diff --git a/htroot/CookieTest_p.java b/htroot/CookieTest_p.java index ad55412fd..6179232f6 100644 --- a/htroot/CookieTest_p.java +++ b/htroot/CookieTest_p.java @@ -31,6 +31,7 @@ import java.util.Iterator; import java.util.Map; import net.yacy.cora.protocol.ResponseHeader; +import net.yacy.cora.util.CommonPattern; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; import net.yacy.server.servletProperties; @@ -56,7 +57,7 @@ public class CookieTest_p { while (it.hasNext()) { e = it.next(); if ("Cookie".equals(e.getKey())) { - final String cookies[] = e.getValue().split(";"); + final String cookies[] = CommonPattern.SEMICOLON.split(e.getValue()); for(final String cookie : cookies) { final String nameValue[] = cookie.split("="); diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.java index 62b8d5950..5c0d130a3 100644 --- a/htroot/Vocabulary_p.java +++ b/htroot/Vocabulary_p.java @@ -40,6 +40,7 @@ import net.yacy.cora.lod.vocabulary.DCTerms; import net.yacy.cora.lod.vocabulary.Tagging; import net.yacy.cora.lod.vocabulary.Tagging.SOTuple; import net.yacy.cora.protocol.RequestHeader; +import net.yacy.cora.util.CommonPattern; import net.yacy.cora.util.ConcurrentLog; import net.yacy.data.WorkTables; import net.yacy.document.LibraryProvider; @@ -170,7 +171,7 @@ public class Vocabulary_p { table.put(s, new Tagging.SOTuple(Tagging.normalizeTerm(s), u0)); } } else if (discoverFromAuthor) { - String[] ts = t.split(";"); // author names are often separated by ';' + String[] ts = CommonPattern.SEMICOLON.split(t); // author names are often separated by ';' for (String s: ts) { if (s.isEmpty()) continue; int p = s.indexOf(','); // check if there is a reversed method to mention the name diff --git a/source/net/yacy/data/UserDB.java b/source/net/yacy/data/UserDB.java index fc0ad9885..3dd211017 100644 --- a/source/net/yacy/data/UserDB.java +++ b/source/net/yacy/data/UserDB.java @@ -42,6 +42,7 @@ import net.yacy.cora.order.CloneableIterator; import net.yacy.cora.order.Digest; import net.yacy.cora.order.NaturalOrder; import net.yacy.cora.protocol.RequestHeader; +import net.yacy.cora.util.CommonPattern; import net.yacy.cora.util.ConcurrentLog; import net.yacy.cora.util.SpaceExceededException; import net.yacy.kelondro.blob.MapHeap; @@ -277,7 +278,7 @@ public final class UserDB { } public static String getLoginToken(final String cookies){ - final String[] cookie = cookies.split(";"); //TODO: Mozilla uses "; " + final String[] cookie = CommonPattern.SEMICOLON.split(cookies); //TODO: Mozilla uses "; " for (final String c :cookie) { String[] pair = c.split("="); if (pair[0].trim().equals("login")) { diff --git a/source/net/yacy/document/content/DCEntry.java b/source/net/yacy/document/content/DCEntry.java index ae403e533..5c44d3dc7 100644 --- a/source/net/yacy/document/content/DCEntry.java +++ b/source/net/yacy/document/content/DCEntry.java @@ -41,6 +41,7 @@ import org.apache.solr.common.params.MultiMapSolrParams; import net.yacy.cora.date.ISO8601Formatter; import net.yacy.cora.document.id.DigestURL; +import net.yacy.cora.util.CommonPattern; import net.yacy.cora.util.ConcurrentLog; import net.yacy.document.Document; @@ -154,7 +155,7 @@ public class DCEntry extends MultiMapSolrParams { public DigestURL getRelation() { String u = this.get("dc:relation"); if (u == null) return null; - String[] urls = u.split(";"); + String[] urls = CommonPattern.SEMICOLON.split(u); if (urls.length > 1) { // select one that fits u = bestU(urls); @@ -287,7 +288,7 @@ public class DCEntry extends MultiMapSolrParams { String[] tx; if (t != null) { t = stripCDATA(t); - return t.split(";"); + return CommonPattern.SEMICOLON.split(t); } tx = this.getParams("dc:subject"); diff --git a/source/net/yacy/document/parser/csvParser.java b/source/net/yacy/document/parser/csvParser.java index dd8ae0d01..c5b46627a 100644 --- a/source/net/yacy/document/parser/csvParser.java +++ b/source/net/yacy/document/parser/csvParser.java @@ -111,7 +111,7 @@ public class csvParser extends AbstractParser implements Parser { if (separator == null) { // try comma, semicolon and tab; take that one that results with more columns final String[] colc = CommonPattern.COMMA.split(row); - final String[] cols = row.split(";"); + final String[] cols = CommonPattern.SEMICOLON.split(row); final String[] colt = row.split("\t"); if (colc.length >= cols.length && colc.length >= colt.length) separator = ","; if (cols.length >= colc.length && cols.length >= colt.length) separator = ";"; diff --git a/source/net/yacy/document/parser/html/ScraperInputStream.java b/source/net/yacy/document/parser/html/ScraperInputStream.java index ac2a763f8..764c4550d 100644 --- a/source/net/yacy/document/parser/html/ScraperInputStream.java +++ b/source/net/yacy/document/parser/html/ScraperInputStream.java @@ -36,6 +36,7 @@ import java.io.Writer; import java.util.Properties; import net.yacy.cora.document.id.DigestURL; +import net.yacy.cora.util.CommonPattern; public class ScraperInputStream extends InputStream implements ScraperListener { @@ -86,7 +87,7 @@ public class ScraperInputStream extends InputStream implements ScraperListener { private static String extractCharsetFromMimetypeHeader(final String mimeType) { if (mimeType == null) return null; - final String[] parts = mimeType.split(";"); + final String[] parts = CommonPattern.SEMICOLON.split(mimeType); if (parts == null || parts.length <= 1) return null; for (int i=1; i < parts.length; i++) { diff --git a/source/net/yacy/document/parser/vcfParser.java b/source/net/yacy/document/parser/vcfParser.java index a60269b1d..0144622ae 100644 --- a/source/net/yacy/document/parser/vcfParser.java +++ b/source/net/yacy/document/parser/vcfParser.java @@ -42,6 +42,7 @@ import java.util.List; import net.yacy.cora.document.encoding.UTF8; import net.yacy.cora.document.id.AnchorURL; import net.yacy.cora.order.Base64Order; +import net.yacy.cora.util.CommonPattern; import net.yacy.document.AbstractParser; import net.yacy.document.Document; import net.yacy.document.Parser; @@ -99,7 +100,7 @@ public class vcfParser extends AbstractParser implements Parser { String value = line.substring(pos+1).trim(); String encoding = null; - final String[] keyParts = key.split(";"); + final String[] keyParts = CommonPattern.SEMICOLON.split(key); if (keyParts.length > 1) { for (final String keyPart : keyParts) { if (keyPart.toUpperCase().startsWith("ENCODING")) {