mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.1.1
This commit is contained in:
@@ -36,7 +36,7 @@ public class Xoa_sys_cfg implements GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_version)) return Xoa_app_.Version;
|
||||
else if (ctx.Match(k, Invk_build_date)) return Xoa_app_.Build_date;
|
||||
else if (ctx.Match(k, Invk_free_mem_when_)) free_mem_when = gplx.ios.Io_size_.parse_or(m.ReadStr("v"), Io_mgr.Len_mb * 5);
|
||||
else if (ctx.Match(k, Invk_free_mem_when_)) free_mem_when = gplx.core.ios.Io_size_.parse_or(m.ReadStr("v"), Io_mgr.Len_mb * 5);
|
||||
else if (ctx.Match(k, Invk_lang)) return lang_key;
|
||||
else if (ctx.Match(k, Invk_lang_)) Lang_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_lang_list)) return Options_lang_list();
|
||||
|
||||
@@ -16,13 +16,13 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps; import gplx.*; import gplx.xowa.*;
|
||||
import gplx.core.net.*; import gplx.langs.jsons.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.net.*; import gplx.core.log_msgs.*; import gplx.langs.jsons.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.dbs.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.fsys.*; import gplx.xowa.apps.metas.*; import gplx.xowa.parsers.amps.*; import gplx.xowa.langs.cases.*; import gplx.core.intls.*; import gplx.xowa.users.data.*;
|
||||
import gplx.xowa.apps.site_cfgs.*; import gplx.xowa.apps.urls.*; import gplx.xowa.files.caches.*; import gplx.xowa.files.imgs.*;
|
||||
import gplx.xowa.bldrs.css.*;
|
||||
import gplx.xowa.apps.gfs.*;
|
||||
import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.wtrs.*; import gplx.xowa.htmls.bridges.*;
|
||||
import gplx.xowa.htmls.hrefs.*; import gplx.xowa.htmls.core.htmls.utls.*; import gplx.xowa.htmls.bridges.*;
|
||||
import gplx.xowa.users.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.wikis.xwikis.parsers.*; import gplx.xowa.wikis.xwikis.sitelinks.*;
|
||||
import gplx.xowa.langs.*;
|
||||
|
||||
@@ -63,6 +63,7 @@ public class Xoav_wiki_mgr implements Xoa_wiki_mgr, GfoInvkAble {
|
||||
hash.Add_if_dupe_use_nth(domain_bry, rv);
|
||||
return rv;
|
||||
}
|
||||
public void Add(Xow_wiki wiki) {hash.Add_if_dupe_use_nth(wiki.Domain_bry(), wiki);}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_import_by_fil)) return Import_by_fil(Io_url_.new_fil_(m.ReadStr("v")));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Xoapi_net implements GfoInvkAble, GfoEvObj {
|
||||
public boolean Enabled() {return enabled;} private boolean enabled = true;
|
||||
public void Enabled_(boolean v) {
|
||||
this.enabled = v;
|
||||
gplx.ios.IoEngine_system.Web_access_enabled = v;
|
||||
gplx.core.ios.IoEngine_system.Web_access_enabled = v;
|
||||
GfoEvMgr_.PubVal(this, gplx.xowa.guis.menus.dom.Xog_mnu_evt_mgr.Evt_selected_changed, v);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.bldrs.filters.dansguardians; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*; import gplx.xowa.apps.apis.xowa.bldrs.filters.*;
|
||||
import gplx.ios.*; import gplx.xowa.bldrs.filters.dansguardians.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.bldrs.filters.dansguardians.*;
|
||||
public class Xoapi_dansguardian implements GfoInvkAble {
|
||||
public void Ctor_by_app(Xoa_app app) {
|
||||
root_dir = app.Fsys_mgr().Bin_xowa_dir().GenSubDir_nest("cfg", "bldr", "filter");
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.bldrs.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*;
|
||||
import gplx.ios.*; import gplx.xowa.wikis.data.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.wikis.data.*;
|
||||
public class Xoapi_import implements GfoInvkAble {
|
||||
public long Layout_all_max() {return layout_all_max;} private long layout_all_max = 0; // disable by default; may set to 200 MB in future
|
||||
public long Layout_text_max() {return layout_text_max;} private long layout_text_max = Io_size_.To_long_by_int_mb(1500); // 1.5 GB
|
||||
@@ -29,6 +29,7 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
public byte[] Ns_file_map() {return ns_file_map;} private byte[] ns_file_map = Ns_file_map__each;
|
||||
public byte Zip_tid_text() {return zip_tid_text;} private byte zip_tid_text = Io_stream_.Tid_gzip;
|
||||
public byte Zip_tid_html() {return zip_tid_html;} private byte zip_tid_html = Io_stream_.Tid_gzip;
|
||||
public boolean Hzip_enabled() {return hzip_enabled;} private boolean hzip_enabled = Bool_.Y;
|
||||
public String User_name() {return user_name;} private String user_name = "anonymous";
|
||||
public Xowd_core_db_props New_props(String domain_str, long dump_file_size) {
|
||||
Xowd_db_layout layout_text, layout_html, layout_file;
|
||||
@@ -39,7 +40,7 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
layout_html = dump_file_size < layout_html_max ? Xowd_db_layout.Itm_few : Xowd_db_layout.Itm_lot;
|
||||
layout_file = dump_file_size < layout_file_max ? Xowd_db_layout.Itm_few : Xowd_db_layout.Itm_lot;
|
||||
}
|
||||
return new Xowd_core_db_props(2, layout_text, layout_html, layout_file, zip_tid_text, zip_tid_html);
|
||||
return new Xowd_core_db_props(2, layout_text, layout_html, layout_file, zip_tid_text, zip_tid_html, hzip_enabled);
|
||||
}
|
||||
public byte[] New_ns_file_map(long dump_file_size) {
|
||||
return dump_file_size < layout_text_max ? Bry_.Empty : Ns_file_map__each;
|
||||
@@ -69,6 +70,8 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_zip_tid_list)) return Options_zip_tid__list;
|
||||
else if (ctx.Match(k, Invk_zip_tid_html)) return Io_stream_.To_str(zip_tid_html);
|
||||
else if (ctx.Match(k, Invk_zip_tid_html_)) zip_tid_html = Io_stream_.To_tid(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_hzip_enabled)) return Yn.To_str(hzip_enabled);
|
||||
else if (ctx.Match(k, Invk_hzip_enabled_)) hzip_enabled = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk_user_name)) return user_name;
|
||||
else if (ctx.Match(k, Invk_user_name_)) user_name = m.ReadStr("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
@@ -88,6 +91,7 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
, Invk_zip_tid_text = "zip_tid_text" , Invk_zip_tid_text_ = "zip_tid_text_", Invk_zip_tid_list = "zip_tid_list"
|
||||
, Invk_zip_tid_html = "zip_tid_html" , Invk_zip_tid_html_ = "zip_tid_html_"
|
||||
, Invk_user_name = "user_name" , Invk_user_name_ = "user_name_"
|
||||
, Invk_hzip_enabled = "hzip_enabled" , Invk_hzip_enabled_ = "hzip_enabled_"
|
||||
;
|
||||
public static final byte[] Ns_file_map__each = Bry_.new_a7("<each>");
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.htmls.tidy.*;
|
||||
import gplx.xowa.htmls.core.htmls.tidy.*;
|
||||
public class Xoapi_tidy implements GfoInvkAble {
|
||||
private Xoae_app app;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.usrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.ios.*; import gplx.xowa.files.caches.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.files.caches.*;
|
||||
public class Xoapi_cache implements GfoInvkAble {
|
||||
private Xou_cache_mgr cache_mgr;
|
||||
public void Init_by_app(Xoa_app app) {this.cache_mgr = app.User().User_db_mgr().Cache_mgr();}
|
||||
|
||||
@@ -24,7 +24,10 @@ public class Xowc_xtn_pages implements GfoInvkAble {
|
||||
public int Ns_index_id() {return ns_index_id;} private int ns_index_id = Int_.Min_value;
|
||||
public int Ns_index_talk_id() {return ns_index_talk_id;} private int ns_index_talk_id = Int_.Min_value;
|
||||
public void Ns_names_(byte[] page_name, byte[] page_talk_name, byte[] index_name, byte[] index_talk_name) {
|
||||
this.page_name = page_name; this.page_talk_name = page_talk_name; this.index_name = index_name; this.index_talk_name = index_talk_name;
|
||||
this.page_name = Xoa_ttl.Replace_spaces(page_name); // ensure underlines, not space; EX:"Mục_lục" not "Mục lục"; PAGE:vi.s:Việt_Nam_sử_lược/Quyển_II DATE:2015-10-27
|
||||
this.page_talk_name = Xoa_ttl.Replace_spaces(page_talk_name);
|
||||
this.index_name = Xoa_ttl.Replace_spaces(index_name);
|
||||
this.index_talk_name = Xoa_ttl.Replace_spaces(index_talk_name);
|
||||
}
|
||||
private byte[]
|
||||
page_name = Default_ns_page_name
|
||||
|
||||
@@ -26,6 +26,13 @@ public class Xowc_xtn_pages_tst {
|
||||
fxt.Test_ns_ids(200, 201, 202, 203);
|
||||
fxt.Test_ns_canonical("Page", "Page_talk", "Index", "Index_talk");
|
||||
}
|
||||
@Test public void Spaces() { // PURPOSE: ensure underlines, not space; EX:"Mục_lục" not "Mục lục"; PAGE:vi.s:Việt_Nam_sử_lược/Quyển_II DATE:2015-10-27
|
||||
fxt.Init_ns(200, "Foreign_page").Init_ns(201, "Foreign_page_talk").Init_ns(202, "Foreign_index").Init_ns(203, "Foreign_index_talk"); // ns set by <siteinfo>
|
||||
fxt.Init_names("Foreign page", "Foreign page talk", "Foreign index", "Foreign index talk"); // ns set by .gfs files in /user/wiki/#cfg
|
||||
fxt.Exec_init();
|
||||
fxt.Test_ns_ids(200, 201, 202, 203);
|
||||
fxt.Test_ns_canonical("Page", "Page_talk", "Index", "Index_talk");
|
||||
}
|
||||
}
|
||||
class Xowc_xtn_pages_fxt {
|
||||
private Xow_ns_mgr ns_mgr;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.fmtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Xoa_fmtr_mgr implements GfoInvkAble {
|
||||
public Xoa_fmtr_mgr(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class Xoa_gfs_bldr {
|
||||
int ary_len = ary.length;
|
||||
for (int i = 0; i < ary_len; i++) {
|
||||
if (i != 0 || cont) bfr.Add_byte(Byte_ascii.Dot);
|
||||
bfr.Add_str(ary[i]);
|
||||
bfr.Add_str_u8(ary[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class Xoa_gfs_bldr {
|
||||
public Xoa_gfs_bldr Add_quote_0() {bfr.Add_byte(Byte_ascii.Apos); return this;}
|
||||
public Xoa_gfs_bldr Add_term_nl() {bfr.Add(Bry_semic_nl); return this;}
|
||||
public Xoa_gfs_bldr Add_eq_str(String k, byte[] v) {
|
||||
bfr.Add_str(k);
|
||||
bfr.Add_str_u8(k);
|
||||
bfr.Add(Bry_eq);
|
||||
bfr.Add_byte_apos();
|
||||
bfr.Add(v);
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.apps.gfs; import gplx.*; import gplx.xowa.*; import gplx.xowa.
|
||||
public class Xoa_gfs_wtr_ {
|
||||
public static byte[] Escape(String v) {return Escape(Bry_.new_u8(v));}
|
||||
public static byte[] Escape(byte[] v) {
|
||||
return Bry_find_.Find_fwd(v, Byte_ascii.Apos) == Bry_.NotFound ? v : Bry_.Replace(v, Byte_ascii.Apos_bry, Bry__apos_escaped);
|
||||
return Bry_find_.Find_fwd(v, Byte_ascii.Apos) == Bry_find_.Not_found ? v : Bry_.Replace(v, Byte_ascii.Apos_bry, Bry__apos_escaped);
|
||||
} private static final byte[] Bry__apos_escaped = Bry_.new_a7("''");
|
||||
public static void Write_prop(Bry_bfr bfr, byte[] prop, byte[] val) {
|
||||
bfr.Add(prop).Add(Bry__val_bgn).Add(Xoa_gfs_wtr_.Escape(val)).Add(Bry__val_end); // EX: "a_('b');\n"
|
||||
@@ -29,7 +29,7 @@ public class Xoa_gfs_wtr_ {
|
||||
int len = ary.length;
|
||||
for (int i = 0; i < len; ++i) {
|
||||
if (i != 0) bfr.Add_byte(Byte_ascii.Dot);
|
||||
bfr.Add_str(ary[i]);
|
||||
bfr.Add_str_u8(ary[i]);
|
||||
}
|
||||
return bfr.To_str_and_rls();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.http; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
import gplx.core.primitives.*; import gplx.core.net.*; import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.apps.*;
|
||||
import gplx.xowa.htmls.js.*;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Socket_rdr {
|
||||
private java.net.ServerSocket server;
|
||||
private java.net.Socket client;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.ios.*; import gplx.texts.*;
|
||||
import gplx.core.ios.*; import gplx.core.texts.*;
|
||||
public class Xosrv_msg_rdr {
|
||||
public Xosrv_msg_rdr(byte[] default_body_bry, IoStream rdr) {this.default_body_bry = default_body_bry; default_body_bry_len = default_body_bry.length; this.rdr = rdr;} private byte[] header_bry = new byte[24], default_body_bry; int default_body_bry_len;
|
||||
public IoStream Rdr() {return rdr;} private IoStream rdr;
|
||||
@@ -45,7 +45,7 @@ public class Xosrv_msg_rdr {
|
||||
}
|
||||
private static byte[] Read_fld(byte[] bry, int bry_len, Int_obj_ref fld_bgn, Bool_obj_ref fail_ref, String_obj_ref fld_ref) {
|
||||
int fld_end = Bry_find_.Find_fwd(bry, Byte_ascii.Pipe, fld_bgn.Val(), bry_len);
|
||||
if (fld_end == Bry_.NotFound) {fail_ref.Val_y_(); return null;}
|
||||
if (fld_end == Bry_find_.Not_found) {fail_ref.Val_y_(); return null;}
|
||||
byte[] rv = Bry_.Mid(bry, fld_bgn.Val(), fld_end);
|
||||
fld_bgn.Val_(fld_end + 1); // +1 to place after pipe
|
||||
return rv;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import org.junit.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Xosrv_msg_rdr_tst {
|
||||
@Before public void init() {fxt.Clear();} private Xosrv_msg_rdr_fxt fxt = new Xosrv_msg_rdr_fxt();
|
||||
@Test public void Parse() {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import gplx.core.primitives.*; import gplx.ios.*; import gplx.langs.jsons.*; import gplx.core.threads.*;
|
||||
import gplx.core.primitives.*; import gplx.core.ios.*; import gplx.langs.jsons.*; import gplx.core.threads.*;
|
||||
public class Xosrv_server implements GfoInvkAble {
|
||||
private long last_cmd;
|
||||
public Xosrv_socket_rdr Rdr() {return rdr;} private Xosrv_socket_rdr rdr = new Xosrv_socket_rdr();
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import org.junit.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Xosrv_server_tst {
|
||||
@Before public void init() {fxt.Clear();} private Xosrv_server_fxt fxt = new Xosrv_server_fxt();
|
||||
@Test public void Exec_js() {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.servers.tcp; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.servers.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.core.ios.*;
|
||||
public class Xosrv_socket_rdr implements GfoInvkAble {
|
||||
private Socket_rdr rdr = new Socket_rdr();
|
||||
public int Port() {return port;} private int port;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Xoa_url__to_str__tst {
|
||||
@Test public void Alias() {
|
||||
fxt.Prep_add_xwiki_to_wiki("wikt", "en.wiktionary.org");
|
||||
Xow_wiki en_d = fxt.Prep_create_wiki("en.wiktionary.org");
|
||||
en_d.Ns_mgr().Ns_main().Case_match_(Xow_ns_case_.Id_all);
|
||||
en_d.Ns_mgr().Ns_main().Case_match_(Xow_ns_case_.Tid__all);
|
||||
fxt.Chk_to_str_href(Bool_.N, "/wiki/wikt:a" , "en.wiktionary.org/wiki/a");
|
||||
}
|
||||
@Test public void Unknown() {fxt.Chk_to_str_href(Bool_.N, "/wiki/{{{extlink}}}" , "");} // {{{extlink}}} not a valid title; return empty
|
||||
|
||||
@@ -238,7 +238,7 @@ public class Xoa_url_parser {
|
||||
private byte[] Bld_page_by_alias(byte[] bry) {
|
||||
if (bry == null) return null;
|
||||
int colon_pos = Bry_find_.Find_fwd(bry, Byte_ascii.Colon); // check for colon; EX: commons:Earth
|
||||
if (colon_pos == Bry_.NotFound) return null; // no colon
|
||||
if (colon_pos == Bry_find_.Not_found) return null; // no colon
|
||||
Xow_wiki alias_wiki = wiki; // default alias_wiki to cur_wiki
|
||||
if (!tmp_wiki_is_missing) // tmp_wiki exists; use it for alias wikis; DATE:2015-09-17
|
||||
alias_wiki = wiki.App().Wiki_mgri().Get_by_key_or_make_init_n(tmp_wiki);
|
||||
|
||||
@@ -56,10 +56,10 @@ public class Xoa_url_parser__xwiki_tst {
|
||||
Xowe_wiki en_d = tstr.Prep_create_wiki("en.wiktionary.org");
|
||||
Xow_ns_mgr ns_mgr = en_d.Ns_mgr();
|
||||
|
||||
ns_mgr.Ns_main().Case_match_(Xow_ns_case_.Id_all);
|
||||
ns_mgr.Ns_main().Case_match_(Xow_ns_case_.Tid__all);
|
||||
tstr.Run_parse("en.wiktionary.org/wiki/a").Chk_wiki("en.wiktionary.org").Chk_page("a");
|
||||
|
||||
ns_mgr.Ns_category().Case_match_(Xow_ns_case_.Id_all);
|
||||
ns_mgr.Ns_category().Case_match_(Xow_ns_case_.Tid__all);
|
||||
tstr.Run_parse("en.wiktionary.org/wiki/Category:a").Chk_wiki("en.wiktionary.org").Chk_page("Category:a");
|
||||
|
||||
tstr.Run_parse("en.wiktionary.org/wiki/A/B/C").Chk_page("A/B/C");
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Xoav_url_parser {
|
||||
}
|
||||
private int Parse_wiki(Xoav_url rv, byte[] src, int src_len, int pos) {
|
||||
int wiki_bgn = pos + Bry_site.length;
|
||||
int wiki_end = Bry_find_.Find_fwd(src, Byte_ascii.Slash, wiki_bgn, src_len); if (wiki_end == Bry_.NotFound) throw Err_.new_wo_type("could not find wiki_end", "src", String_.new_u8(src));
|
||||
int wiki_end = Bry_find_.Find_fwd(src, Byte_ascii.Slash, wiki_bgn, src_len); if (wiki_end == Bry_find_.Not_found) throw Err_.new_wo_type("could not find wiki_end", "src", String_.new_u8(src));
|
||||
rv.Wiki_bry_(Bry_.Mid(src, wiki_bgn, wiki_end));
|
||||
return wiki_end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user