版間での差分

項目2023年5月20日 (土) 20:40Dragoniez による版2023年5月20日 (土) 20:47Dragoniez による版
フィルター条件
条件:
/* 無資格利用者による投稿 */
/* 無資格利用者による投稿 */


tp_head := "\{\{(:?template:|:?テンプレート:)?";
tp_head := "\{\{(:?template:|:?テンプレート:)?";
tp_tail := "(\||\}\})";
tp_tail := "(\||\}\})";


equals_to_any(action, "edit", "move")
equals_to_any(action, "edit", "move")
&  user_editcount < 50 /* 無資格利用者の共通条件: 編集回数50回未満 */
&  user_editcount < 50 /* 無資格利用者の共通条件: 編集回数50回未満 */
&  !contains_any(user_groups, "bot")
&  !contains_any(user_groups, "bot")


&
&
(  /* 削除依頼関連 */
(
    action === "edit"
    (  /* 削除依頼関連 */
    &
        action === "edit"
    page_prefixedtitle rlike rmwhitespace("
        &
        ^Wikipedia:(
        page_prefixedtitle rlike rmwhitespace("
            (削除依頼\/.+)
            ^Wikipedia:(
            |利用者ページの削除依頼
                (削除依頼\/.+)
            |削除の復帰依頼
                |利用者ページの削除依頼
            |リダイレクトの削除依頼\/受付
                |削除の復帰依頼
        )$
                |リダイレクトの削除依頼\/受付
    ")
            )$
    &
        ")
    (  /* リダイレクトの削除依頼の場合、阻止対象になり得るのはIP利用者の投稿のみ */
        &
        if (page_prefixedtitle === "Wikipedia:リダイレクトの削除依頼/受付") then (
        (  /* リダイレクトの削除依頼の場合、阻止対象になり得るのはIP利用者の投稿のみ */
            user_age === 0
            if (page_prefixedtitle === "Wikipedia:リダイレクトの削除依頼/受付") then (
         ) end
                user_age === 0
            ) end
        )
        &
        (  /* 編集内容に投票を含む */
            votes := rmwhitespace("(
                (だみーダミーdummy)
                |全?削除
                |(即時|全即時)?削除
                |中立
                |一部(削除|存続)?
                |特定版(削除)?
                |版指定(削除)?
                |即時版指定(削除)?
                |緊急
                |緊急版指定(削除)?
                |緊急即時(削除)?
                |全?存続
                |全?即時存続
                |履歴統合
                |(他プロジェクトへ)?移動
                |保留
                |賛成|復帰
                |反対
            )");
            afd := tp_head + "(([Aa]FD|[Aa]fd|[Rr]FU)\|(1=)?)?" + votes + tp_tail;
            kakko := "(" + votes + ")";
           
            (rmwhitespace(added_lines) rlike afd & !rmwhitespace(removed_lines) rlike afd)
            |
            (rmwhitespace(added_lines) rlike kakko & !rmwhitespace(removed_lines) rlike kakko)
         )
     )
     )
     &
     |
     (  /* 編集内容に投票を含む */
     (  /* 投稿ブロック依頼 */
         votes := rmwhitespace("(
   
            (だみーダミーdummy)
         title := action === "edit" ? page_prefixedtitle : moved_to_prefixedtitle;
            |全?削除
       
            |(即時|全即時)?削除
        /* 編集対象または移動先がRFBサブページ、かつアカウント作成から30日未満 */
            |中立
         title rlike "^Wikipedia:投稿ブロック依頼\/.+$"
            |一部(削除|存続)?
         &  user_age < 60*60*24*30 /* 30 days; IPは必ずtrue */
            |特定版(削除)?
            |版指定(削除)?
            |即時版指定(削除)?
            |緊急
            |緊急版指定(削除)?
            |緊急即時(削除)?
            |全?存続
            |全?即時存続
            |履歴統合
            |(他プロジェクトへ)?移動
            |保留
            |賛成|復帰
            |反対
         )");
        afd := tp_head + "(([Aa]FD|[Aa]fd|[Rr]FU)\|(1=)?)?" + votes + tp_tail;
         kakko := "(" + votes + ")";
          
          
         (rmwhitespace(added_lines) rlike afd & !rmwhitespace(removed_lines) rlike afd)
        /* 阻止条件詳細 */
        |
        &
        (rmwhitespace(added_lines) rlike kakko & !rmwhitespace(removed_lines) rlike kakko)
         (   /* 編集操作 */
     )
            if (action === "edit") then (
)
   
|
                page_age === 0 /* 作成不許可 */
/* 投稿ブロック依頼 */
                |
 
                (  /* 編集不許可 */
    title := action === "edit" ? page_prefixedtitle : moved_to_prefixedtitle;
                    wikitext := rmwhitespace(str_replace(old_wikitext, "_", ""));
   
                    /* 被依頼者でないことを担保するために、{{User}}などで言及されている場合は除外 */
                    if (user_age !== 0) then (
   
                        /* 編集者がログイン利用者かつテンプレートでの利用者名の言及無し*/
                        user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + rmwhitespace(rescape(user_name)) + tp_tail;
                        !wikitext rlike user_template
      
                    ) else (
   
                        /* IPアドレスの2ブロック目までを抽出 (e.g. "111.222.", "FFFF:FFFF:")*/
                        ip_type := user_name contains ":" ? "IPv6" : "IPv4";
                        ip_range := ip_type === "IPv6" ? get_matches("^[\dA-F]+:[\dA-F]+:", user_name)[0] : get_matches("^\d+\.\d+\.", user_name)[0];
                        ip_range := "(?i:" + rescape(ip_range) + ")";
                       
                        /* {{User|111.222.xxx.yyy}}のようなテンプレートがない*/
                        user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + ip_range + "[^\|\}]+" + tp_tail;
                        ip_template := tp_head + "[Ii][Pp]([Uu]ser)?2?\|(1=)?" + ip_range + "[^\|\}]+" + tp_tail;
      
      
    /* 編集対象または移動先がRFBサブページ、かつアカウント作成から30日未満 */
                        !wikitext rlike user_template & !wikitext rlike ip_template
    title rlike "^Wikipedia:投稿ブロック依頼\/.+$"
    &   user_age < 60*60*24*30 /* 30 days; IPは必ずtrue */
      
      
    /* 阻止条件詳細 */
                     ) end
    &
    (  /* 編集操作 */
        if (action === "edit") then (
 
            page_age === 0 /* 作成不許可 */
            |
            (  /* 編集不許可 */
                wikitext := rmwhitespace(str_replace(old_wikitext, "_", ""));
 
                /* 被依頼者でないことを担保するために、{{User}}などで言及されている場合は除外 */
                if (user_age !== 0) then (
 
                    /* 編集者がログイン利用者かつテンプレートでの利用者名の言及無し*/
                    user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + rmwhitespace(rescape(user_name)) + tp_tail;
                    !wikitext rlike user_template
 
                ) else (
 
                     /* IPアドレスの2ブロック目までを抽出 (e.g. "111.222.", "FFFF:FFFF:")*/
                    ip_type := user_name contains ":" ? "IPv6" : "IPv4";
                    ip_range := ip_type === "IPv6" ? get_matches("^[\dA-F]+:[\dA-F]+:", user_name)[0] : get_matches("^\d+\.\d+\.", user_name)[0];
                    ip_range := "(?i:" + rescape(ip_range) + ")";
                      
                      
                    /* {{User|111.222.xxx.yyy}}のようなテンプレートがない*/
                 )
                    user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + ip_range + "[^\|\}]+" + tp_tail;
   
                    ip_template := tp_head + "[Ii][Pp]([Uu]ser)?2?\|(1=)?" + ip_range + "[^\|\}]+" + tp_tail;
             /* 移動操作の場合追加条件なしで阻止 */
 
            ) else (
                    !wikitext rlike user_template & !wikitext rlike ip_template
                true
 
             ) end
                 ) end
         )
               
   
             )
 
        /* 移動操作の場合追加条件なしで阻止 */
        ) else (
             true
         ) end
     )
     )
)
)