編集フィルター設定

版間での差分

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


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")


&
&
(  /* 削除依頼関連 */
(  /* 削除依頼関連 */
     action === "edit"
     action === "edit"
     &
     &
     page_prefixedtitle rlike rmwhitespace("
     page_prefixedtitle rlike rmwhitespace("
         ^Wikipedia:(
         ^Wikipedia:(
             (削除依頼\/.+)
             (削除依頼\/.+)
             |利用者ページの削除依頼
             |利用者ページの削除依頼
             |削除の復帰依頼
             |削除の復帰依頼
             (?#|リダイレクトの削除依頼\/受付)
             (?#|リダイレクトの削除依頼\/受付)
         )$
         )$
     ")
     ")
     &
     &
     (  /* 編集内容に投票を含む */
     (  /* 編集内容に投票を含む */
         votes := rmwhitespace("
         votes := rmwhitespace("(
             (だみーダミーdummy)
             (だみーダミーdummy)
             |全?削除
             |全?削除
             |(即時|全即時)?削除
             |(即時|全即時)?削除
             |中立
             |中立
             |一部(削除|存続)?
             |一部(削除|存続)?
             |特定版(削除)?
             |特定版(削除)?
             |版指定(削除)?
             |版指定(削除)?
             |即時版指定(削除)?
             |即時版指定(削除)?
             |緊急
             |緊急
             |緊急版指定(削除)?
             |緊急版指定(削除)?
             |緊急即時(削除)?
             |緊急即時(削除)?
             |全?存続
             |全?存続
             |全?即時存続
             |全?即時存続
             |履歴統合
             |履歴統合
             |(他プロジェクトへ)?移動
             |(他プロジェクトへ)?移動
             |保留
             |保留
             |賛成|復帰
             |賛成|復帰
             |反対
             |反対
         ");
         )");
         afd := tp_head + "(([Aa]FD|[Aa]fd|[Rr]FU)\|(1=)?)?" + votes + tp_tail;
         afd := tp_head + "(([Aa]FD|[Aa]fd|[Rr]FU)\|(1=)?)?" + votes + tp_tail;
         kakko := "(" + votes + ")";
         kakko := "(" + votes + ")";
          
          
         (rmwhitespace(added_lines) rlike afd & !rmwhitespace(removed_lines) rlike afd)
         (rmwhitespace(added_lines) rlike afd & !rmwhitespace(removed_lines) rlike afd)
         |
         |
         (rmwhitespace(added_lines) rlike kakko & !rmwhitespace(removed_lines) rlike kakko)
         (rmwhitespace(added_lines) rlike kakko & !rmwhitespace(removed_lines) rlike kakko)
     )
     )
)
)
|
|
(  /* 投稿ブロック依頼 */
(  /* 投稿ブロック依頼 */


     title := action === "edit" ? page_prefixedtitle : moved_to_prefixedtitle;
     title := action === "edit" ? page_prefixedtitle : moved_to_prefixedtitle;
      
      
     /* 編集対象または移動先がRFBサブページ、かつアカウント作成から30日未満 */
     /* 編集対象または移動先がRFBサブページ、かつアカウント作成から30日未満 */
     title rlike "^Wikipedia:投稿ブロック依頼\/.+$"
     title rlike "^Wikipedia:投稿ブロック依頼\/.+$"
     &  user_age < 60*60*24*30 /* 30 days; IPは必ずtrue */
     &  user_age < 60*60*24*30 /* 30 days; IPは必ずtrue */
      
      
     /* 阻止条件詳細 */
     /* 阻止条件詳細 */
     &
     &
     (  /* 編集操作 (移動操作の場合追加条件なしで阻止) */
     (  /* 編集操作 */
         if (action === "edit") then (
         if (action === "edit") then (


             page_age === 0 /* 作成不許可 */
             page_age === 0 /* 作成不許可 */
             |
             |
             (  /* 編集不許可 */
             (  /* 編集不許可 */
                 wikitext := rmwhitespace(str_replace(old_wikitext, "_", ""));
                 wikitext := rmwhitespace(str_replace(old_wikitext, "_", ""));


                 /* 被依頼者でないことを担保するために、{{User}}などで言及されている場合は除外 */
                 /* 被依頼者でないことを担保するために、{{User}}などで言及されている場合は除外 */
                 if (user_age !== 0) then (
                 if (user_age !== 0) then (


                     /* 編集者がログイン利用者かつテンプレートでの利用者名の言及無し*/
                     /* 編集者がログイン利用者かつテンプレートでの利用者名の言及無し*/
                     user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + rmwhitespace(rescape(user_name)) + tp_tail;
                     user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + rmwhitespace(rescape(user_name)) + tp_tail;
                     !wikitext rlike user_template
                     !wikitext rlike user_template


                 ) else (
                 ) else (


                     /* IPアドレスの2ブロック目までを抽出 (e.g. "111.222.", "FFFF:FFFF:")*/
                     /* IPアドレスの2ブロック目までを抽出 (e.g. "111.222.", "FFFF:FFFF:")*/
                     ip_type := user_name contains ":" ? "IPv6" : "IPv4";
                     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 := 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) + ")";
                     ip_range := "(?i:" + rescape(ip_range) + ")";
                      
                      
                     /* {{User|111.222.xxx.yyy}}のようなテンプレートがない*/
                     /* {{User|111.222.xxx.yyy}}のようなテンプレートがない*/
                     user_template := tp_head + "[Uu]ser[2345R]?\|(1=)?" + ip_range + "[^\|\}]+" + tp_tail;
                     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;
                     ip_template := tp_head + "[Ii][Pp]([Uu]ser)?2?\|(1=)?" + ip_range + "[^\|\}]+" + tp_tail;


                     !wikitext rlike user_template & !wikitext rlike ip_template
                     !wikitext rlike user_template & !wikitext rlike ip_template


                 ) end
                 ) end
                  
                  
             )
             )


        /* 移動操作の場合追加条件なしで阻止 */
        ) else (
            true
         ) end
         ) end
     )
     )


)
)