])([\w]*?)((ht|f)tp(s)?:\/\/[\w]+[^ \,\"\n\r\t<]*[^.:?!;) \,\"\n\r\t<])/is';
const GENERIC_REF_NUM = '/\B(>|>){2}(\d+)\b/Us';
const GENERIC_REF_LIT = '/\B(>|>){3}(\w+)\/(\d+)\b/Us';
const GENERIC_QUOTE = '/^>(.+)$/Um';
const T_BB_SPOILER = '/\[(sp|spoiler)\](.+)\[\/\1\]/Us';
const T_BB_STRIKEOUT = '/(\^{2})(.+)\1/Us';
const T_BB_BOLD = '/(\*{2})(.+)\1/Us';
const T_BB_ITALIC = '/(\*{1})(.+)\1/Us';
const T_BB_FORMAT = '/\[(i|b|u|s|q|sup|sub)\](.+)\[\/\1\]/Us';
const T_BB_TEXTWALL = '/\[(text|t|tw)\](.+)\[\/\1\]/Us';
const T_BB_RED = '/\[(red)\](.+)\[\/\1\]/Uis';
const T_BB_GREEN = '/\[(green)\](.+)\[\/\1\]/Uis';
const T_BB_BLUE = '/\[(blue)\](.+)\[\/\1\]/Uis';
const T_WM_SPOILER = '/(%{2})(.+)\1/Us';
const T_WM_STRIKEOUT = '/(\^{2})(.+)\1/Us';
const T_WM_BOLD = '/(\*{2})(.+)\1/Us';
const T_WM_ITALIC = '/(\*{1})(.+)\1/Us';
const T_WM_UNDERLINE = '/(_{2})(.+)\1/Us';
const T_WM_HEADER = '/(={2})(.+)\1/U';
const T_RAW = '/\[(ascii|raw)\](.+)\[\/\1\]/Us';
const T_LATEX = '/\[(latex)\](.+)\[\/\1\]/Uis';
const T_WM_CODE = '/(`{2})(.+)\1/Us';
const T_BB_CODE = '/\[(code)\](.+)\[\/\1\]/Us';
const FS_GOOGLE = '/google:\/\/([^\/]+)\//';
const FS_DDG = '/ddg:\/\/([^\/]+)\//';
const FS_WIKI = '/wiki:\/\/([^\/]+)\//';
const FS_WOLFRAM = '/wolfram:\/\/([^\/]+)\//';
const FS_GIT = '/git:\/\/([^\/]+)\//';
const FS_LAIN = '/lain:\/\/([^\/]+)\//';
const TRIPCODE = "/.+(#|!)(.+)$/";
const TRIFORCE = '/^\/triforce$/m';
const SERVICE_YT = '/youtu/i';
const SERVICE_YT_ID = '/embed(\W+)([0-9A-Za-z-_]+)\?/';
const SERVICE_VI = '/vimeo/i';
const SERVICE_VI_ID = '/video(\/|%2F)(\d+)/i';
const SERVICE_SC = '/soundcloud/i';
const SERVICE_SC_ID = '/tracks(\/|%2F)(\d+)/i';
const SPAM = '/(discou.rs|дискурс|anonum|анонум|\/\/t.me\/)/i';
const EXTERNAL = '/https?:\/\/([\w\d\.,_-]+\.)?(mixtape\.moe|catbox\.moe|safe\.moe|0x0\.st)/i';
const INTERNAL = '/https?:\/\/([\w\d\.,_-]+\.)?'.HOST.'/i';
public static function escape($string){
$_ = array(
'/\'/' => ''',
'/%/' => '%',
'/\*/' => '*',
'/\^/' => '^',
'/~/' => '~',
'/_/' => '_',
'/\[/' => '[',
'/\]/' => ']',
'/\\\/' => '\',
'/\//' => '/',
'/=/' => '='
);
return preg_replace(array_keys($_),array_values($_),$string);
}
public static function has_preview($type){
return preg_match(static::TYPE_IMAGE,$type) || preg_match(static::TYPE_VIDEO,$type);
}
public static function mime_has_preview($type){
return preg_match(static::MIME_IMAGE,$type) || preg_match(static::MIME_VIDEO,$type);
}
public static function get_file_name($file){ preg_match('/(.+)\.[^\.]+$/', $file, $o); return y($o[1], ""); }
public static function get_extension($file){ preg_match('/.+\.([^\.]+)$/', $file, $o); return y($o[1], ""); }
public static function cut($subject){
$repo = [
'UFO',
'MLP',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'[ДАННЫЕ УДАЛЕНЫ]',
'▓▓▓▓▓',
'▓▓▓▓▓▓',
'▓▓▓▓▓▓▓',
'▓▓▓▓▓▓▓▓',
'▓▓▓▓▓▓▓▓▓',
'(амнезиак визуального действия)',
'(not kawaii enough)',
'(not nyashno enough)',
'(продам гараж)',
'[p/r intensifies]',
'(I secretly suck dicks)',
'DICKBUTT',
'[autistic screaming]',
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'(nyan, motherfucker, do you speak it?)',
'(у автора убежал чайник)',
'(шутка про ICMP, дошло?)',
'(slow mail service could not deliver this packet)',
'NANI!?',
'(omae wa, mou shindeiru)',
'[modem sounds]',
'(Ph`nglui mglw`nafh Cthulhu R`lyeh wgah`nagl fhtagn!)',
'(oh shit~)',
'?!+',
'(I sexually identify myself as a helicopter)',
'(uhm.. NYAN?!)',
'(NIGGA THERE WAS SOME REALLY CREEPY SHIT RIGHT HERE)',
'(fuck social networks)',
'!q',
'(we interrupt this message to bring you a special message from the new president of the world)',
'(HEIL NYAN!)',
'(gotcha!)',
'(want some snickers?)',
'(this is bait)',
'(nyan cat ate this text)',
'(VIRUS.EXE)',
'(cyka, blyad)',
'♪',
'♫',
'「 ● ● ● ● 」',
'(IT`S ADVERTISING TIME! - NO DAD, NO!)',
'(zero nyans were given to this post)',
'(this is a golden post)',
'(this is a platinum post)',
'(unlock this text for only $3.99)',
'(nothing to look at)',
'(move along)',
'(нечего увидеть здесь. двиньте вперёд)',
'6555',
'(oops, divided by zero)',
'(oops, divided by zero)',
'(oops, divided by zero)',
'(oops, divided by zero)',
'(там ракуй, а здесь не надо)',
'(не возвращайся никогда)',
'(уходи с моих нульчей)',
'(для того нужна сажа, чтоб ты съебался навсегда)',
'ПШШШ',
'ПШШШШ',
'ПШШШШШ',
'ПШШШШШШ',
'ПШШШШШШШ',
'(пыщъ)'
];
$replacement = ''
.$repo[mt_rand(0,count($repo)-1)]
."";
return preg_replace(static::SPAM, $replacement, $subject);
}
}