truncate category urls with \n else page history will not load correctly

v3.3.4
gnosygnu 8 years ago
parent e18a0ac82f
commit 9a28378d50

@ -20,6 +20,12 @@ import gplx.core.primitives.*;
public class Xou_history_itm { public class Xou_history_itm {
private Xou_history_itm() {} private Xou_history_itm() {}
public Xou_history_itm(byte[] wiki, byte[] page) { public Xou_history_itm(byte[] wiki, byte[] page) {
// remove "\n" from page for Category b/c it breaks the csv_parser; DATE:2016-10-12
int nl_pos = Bry_find_.Find_fwd(page, Byte_ascii.Nl);
if (nl_pos != Bry_find_.Not_found) {
page = Bry_.Mid(page, 0, nl_pos);
}
this.wiki = wiki; this.wiki = wiki;
this.page = page; this.page = page;
this.key = key_(wiki, page); this.key = key_(wiki, page);

@ -42,6 +42,11 @@ public class Xou_history_mgr_tst {
fxt.Add_one("Special:AllPages", "?from=A"); fxt.Add_one("Special:AllPages", "?from=A");
fxt.List_tst("Special:AllPages?from=A"); fxt.List_tst("Special:AllPages?from=A");
} }
@Test public void Remove_nl() {
fxt.Clear();
fxt.Add_many("Category:A?pagefrom=B\nB");
fxt.List_tst("Category:A?pagefrom=B");
}
} }
class Xou_history_mgr_fxt { class Xou_history_mgr_fxt {
Xoae_app app; Xowe_wiki wiki; Xoae_app app; Xowe_wiki wiki;

Loading…
Cancel
Save