Abuse filter management

Abuse Filter navigation (Home | Recent filter changes | Examine past edits | Abuse log)

Differences between versions

ItemVersion from 05:06, 18 December 2024 by PeaceDeadCVersion from 05:38, 18 December 2024 by PeaceDeadC
Basic information
Notes:
# Title: Block full URLs in social media parameters
# Actions: disallow
# Notes:
This filter prevents users from adding full URLs to social media parameters in templates. Users should only provide handles/usernames without the domain part.


Examples of correct usage:
- |facebook=username
- |twitter=handle
- |instagram=profile
Examples of incorrect usage:
- |facebook=https://facebook.com/username
- |twitter=http://twitter.com/handle
- |instagram=https://instagram.com/profile
Affected parameters:
- Social networks: facebook, x, vk, instagram, threads, tiktok, reddit, telegram, myspace, linkedin, xing
- Content platforms: youtube (user/channel/handle), soundcloud, mixcloud
- Model portfolios: modelmayhem, onemodelplace, starnow
- Image sharing: flickr, foursquare, pinterest, photobucket
- Streaming: twitch, patreon
Filter conditions
Conditions:
/* Проверяем правки в основном пространстве имен */
equals_to_any(page_namespace, 0) &
equals_to_any(page_namespace, 0) &
(
(
     /* Ищем строки с параметром facebook, содержащим любой вариант URL
     /* Define patterns for each platform's URL format */
      (?:www\\.)? - опциональный www
     social_pattern := "\\|\\s*(?:facebook|x|vk|instagram|threads|tiktok|reddit|telegram|myspace|linkedin|xing)\\s*=\\s*(?:https?://)?(?:www\\.)?(?:facebook\\.com/|x\\.com/|vk\\.com/|instagram\\.com/|threads\\.net/@|tiktok\\.com/@|reddit\\.com/user/|t\\.me/s/|myspace\\.com/|linkedin\\.com/in/|xing\\.com/profile/)[^\\|\\}]+";
      https?:// - поддержка как http, так и https */
     fb_pattern := "\\|\\s*facebook\\s*=\\s*(?:https?://)?(?:www\\.)?facebook\\.com/[^\\|\\}]+";
      
      
     /* Проверяем добавленные строки на наличие некорректного формата */
     youtube_pattern := "\\|\\s*youtube(?:channel|-handle)?\\s*=\\s*(?:https?://)?(?:www\\.)?youtube\\.com/(?:user/|channel/|@)[^\\|\\}]+";
    added_lines rlike fb_pattern &
      
      
     /* Исключаем откаты и действия ботов */
    media_pattern := "\\|\\s*(?:soundcloud|mixcloud)\\s*=\\s*(?:https?://)?(?:www\\.)?(?:soundcloud\\.com/|mixcloud\\.com/)[^\\|\\}]+";
   
    model_pattern := "\\|\\s*(?:modelmayhem|onemodelplace|starnow)\\s*=\\s*(?:https?://)?(?:www\\.)?(?:modelmayhem\\.com/|onemodelplace\\.com/models/|starnow\\.com/)[^\\|\\}]+";
   
    image_pattern := "\\|\\s*(?:flickr|foursquare|pinterest|photobucket)\\s*=\\s*(?:https?://)?(?:www\\.)?(?:flickr\\.com/people/|foursquare\\.com/|pinterest\\.com/|photobucket\\.com/user/)[^\\|\\}]+";
   
    stream_pattern := "\\|\\s*(?:twitch|patreon)\\s*=\\s*(?:https?://)?(?:www\\.)?(?:twitch\\.tv/|patreon\\.com/)[^\\|\\}]+";
   
    /* Check added lines against all patterns */
    added_lines rlike social_pattern |
    added_lines rlike youtube_pattern |
    added_lines rlike media_pattern |
    added_lines rlike model_pattern |
    added_lines rlike image_pattern |
    added_lines rlike stream_pattern &
   
     /* Exclude bots and reverts */
     !("bot" in user_groups) &
     !("bot" in user_groups) &
     !(summary rlike "^(?:revert|rv|undid)") &
     !(summary rlike "^(?:revert|rv|undid)") &
      
      
     /* Исключаем шаблоны удаления и подобные служебные шаблоны */
     /* Exclude deletion templates */
     !(added_lines rlike "\\{\\{(db[\\-\\|]|delete\\||sd\\||speedy deletion)")
     !(added_lines rlike "\\{\\{(db[\\-\\|]|delete\\||sd\\||speedy deletion)")
)
)