mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.7.3.1'
This commit is contained in:
@@ -27,7 +27,7 @@ public class Pfunc_anchorencode extends Pf_func_base { // EX: {{anchorencode:a b
|
||||
if (anchor_ctx != null) return;// NOTE: called by Scrib_uri
|
||||
encode_trie.Add(Byte_ascii.Colon, Bfr_arg_.New_byte(Byte_ascii.Colon));
|
||||
encode_trie.Add(Byte_ascii.Space, Bfr_arg_.New_byte(Byte_ascii.Underline));
|
||||
anchor_ctx = Xop_ctx.new_sub_(ctx);
|
||||
anchor_ctx = Xop_ctx.New__sub__reuse_page(ctx);
|
||||
anchor_ctx.Para().Enabled_n_();
|
||||
anchor_tkn_mkr = anchor_ctx.Tkn_mkr();
|
||||
anchor_parser = ctx.Wiki().Parser_mgr().Anchor_encoder();
|
||||
|
||||
@@ -53,10 +53,12 @@ public class Pfunc_filepath extends Pf_func_base {
|
||||
if (page.Db().Page().Exists_n()) { // file not found in current wiki; try commons;
|
||||
Xowe_wiki commons_wiki = (Xowe_wiki)wiki.Appe().Wiki_mgr().Get_by_or_null(wiki.Commons_wiki_key());
|
||||
if (commons_wiki != null) { // commons_wiki not installed; exit; DATE:2013-06-08
|
||||
synchronized (commons_wiki) { // LOCK:app-level; wiki.commons; DATE:2016-07-06
|
||||
if (!Env_.Mode_testing()) commons_wiki.Init_assert();// must assert load else page_zip never detected; DATE:2013-03-10
|
||||
page = commons_wiki.Data_mgr().Load_page_by_ttl(ttl);
|
||||
if (!Env_.Mode_testing()) {
|
||||
synchronized (commons_wiki) { // LOCK:app-level; wiki.commons; DATE:2016-07-06
|
||||
commons_wiki.Init_assert();// must assert load else page_zip never detected; DATE:2013-03-10
|
||||
}
|
||||
}
|
||||
page = commons_wiki.Data_mgr().Load_page_by_ttl(ttl);
|
||||
}
|
||||
}
|
||||
return page;
|
||||
|
||||
@@ -67,8 +67,9 @@ public class Pfunc_rel2abs extends Pf_func_base {
|
||||
if (qry_len == 0) return src;// no qry; return src; EX:{{#rel2abs:|a/b}} -> a/b
|
||||
byte[] tmp = src;
|
||||
int tmp_adj = 0, i = 0, prv_slash_end = 0, tmp_len = src_len, seg_pos = 0;
|
||||
boolean tmp_is_1st = true;
|
||||
Object o = qry_bgns_with.Match_bgn(qry, 0, qry_len); // check if qry begins with ".", "/", "./", "../"; if it doesn't return;
|
||||
boolean tmp_is_1st = true;
|
||||
Btrie_rv trv = new Btrie_rv();
|
||||
Object o = qry_bgns_with.Match_at(trv, qry, 0, qry_len); // check if qry begins with ".", "/", "./", "../"; if it doesn't return;
|
||||
if (o != null) {
|
||||
int id = ((Int_obj_ref)o).Val();
|
||||
rel2abs_tid.Val_(id);
|
||||
@@ -80,7 +81,7 @@ public class Pfunc_rel2abs extends Pf_func_base {
|
||||
case Id_dot_dot_slash: // "../"
|
||||
break; // qry is relative to src; noop
|
||||
case Id_dot_dot: // ".."
|
||||
int match_end = qry_bgns_with.Match_pos();
|
||||
int match_end = trv.Pos();
|
||||
if (match_end < qry_len && qry[match_end] == Byte_ascii.Dot) // NOTE: handles "..."; if "...*" then treat as invalid and return; needed for en.wiktionary.org/wiki/Wiktionary:Requests for cleanup/archive/2006
|
||||
return qry;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user