diff --git a/.env.example b/.env.example index baa11b29f7876eff61da16ba0b876fc67086d1f7..9273d9a6911cacf398eeedf7bf0c292fa52d1d68 100644 --- a/.env.example +++ b/.env.example @@ -40,4 +40,7 @@ PUSHER_SECRET= PROJECT_NAME=MetaGer BRANCH_NAME=Local -COMMIT_NAME=Testing \ No newline at end of file +COMMIT_NAME=Testing + +#PROXY_HOST= +#PROXY_PORT= \ No newline at end of file diff --git a/app/Http/Controllers/MetaGerSearch.php b/app/Http/Controllers/MetaGerSearch.php index 032d739bdd2a8d0c2fcdd33a8fa08e10008eb1bd..d1d1f592684015da37811d1e7e0a83d48bdaa1ed 100644 --- a/app/Http/Controllers/MetaGerSearch.php +++ b/app/Http/Controllers/MetaGerSearch.php @@ -22,11 +22,6 @@ class MetaGerSearch extends Controller $timings = ['starttime' => microtime(true)]; } $time = microtime(true); - $spamEntries = []; - $spamEntry = null; - if (file_exists(config_path('spam.txt'))) { - $spamEntries = file(config_path('spam.txt')); - } $focus = $request->input("focus", "web"); @@ -41,17 +36,6 @@ class MetaGerSearch extends Controller return redirect(LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), '/')); } - foreach ($spamEntries as $index => $entry) { - $entry = trim($entry); - if (empty($entry)) { - continue; - } - if (preg_match("/" . $entry . "/si", $eingabe)) { - $spamEntry = $entry; - break; - } - } - # Mit gelieferte Formulardaten parsen und abspeichern: $metager->parseFormData($request); if (!empty($timings)) { @@ -70,12 +54,6 @@ class MetaGerSearch extends Controller return $metager->createView(); } - if ($spamEntry !== null && Cache::has('spam.' . $metager->getFokus() . "." . md5($spamEntry))) { - $responseContent = Cache::get('spam.' . $metager->getFokus() . "." . md5($spamEntry)); - $responseContent = preg_replace('/(name="eingabe"\s+value=")[^"]+/', "$1$eingabe", $responseContent); - return response($responseContent); - } - $quicktips = $metager->createQuicktips(); if (!empty($timings)) { $timings["createQuicktips"] = microtime(true) - $time; @@ -143,13 +121,6 @@ class MetaGerSearch extends Controller # Die Ausgabe erstellen: $resultpage = $metager->createView($quicktipResults); - if ($spamEntry !== null) { - try { - Cache::put('spam.' . $metager->getFokus() . "." . md5($spamEntry), $resultpage->render(), 604800); - } catch (\Exception $e) { - Log::error($e->getMessage()); - } - } if (!empty($timings)) { $timings["createView"] = microtime(true) - $time; diff --git a/app/MetaGer.php b/app/MetaGer.php index 144b9e0789a3cd45c106036329dc9e79b90b5dd8..d2a10ba34a14f6d14f2141dc8a4a5a3cc20b3e5a 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -90,17 +90,17 @@ class MetaGer $this->domainsBlacklisted = explode("\n", $tmp); $tmp = file_get_contents(config_path() . "/blacklistUrl.txt"); $this->urlsBlacklisted = explode("\n", $tmp); - } else { - Log::warning("Achtung: Eine, oder mehrere Blacklist Dateien, konnten nicht geöffnet werden"); } + # Versuchen Blacklists einzulesen - if (file_exists(config_path() . "/adBlacklistDomains.txt") && file_exists(config_path() . "/adBlacklistUrl.txt")) { + if (file_exists(config_path() . "/adBlacklistDomains.txt")) { $tmp = file_get_contents(config_path() . "/adBlacklistDomains.txt"); $this->adDomainsBlacklisted = explode("\n", $tmp); + } + + if(file_exists(config_path() . "/adBlacklistUrl.txt")){ $tmp = file_get_contents(config_path() . "/adBlacklistUrl.txt"); $this->adUrlsBlacklisted = explode("\n", $tmp); - } else { - Log::warning("Achtung: Eine, oder mehrere Blacklist Dateien, konnten nicht geöffnet werden"); } # Parser Skripte einhängen diff --git a/app/Models/Result.php b/app/Models/Result.php index 91b40fd4cde68397015678e7a1824b9f1fd9a500..88a56477f265ef9e5844b08da1c5e4951ae2dfcb 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -39,11 +39,11 @@ class Result public function __construct($provider, $titel, $link, $anzeigeLink, $descr, $gefVon, $gefVonLink, $sourceRank, $additionalInformation = []) { $this->provider = $provider; - $this->titel = strip_tags(trim($titel)); + $this->titel = $this->sanitizeText(strip_tags(trim($titel))); $this->link = trim($link); $this->anzeigeLink = trim($anzeigeLink); $this->anzeigeLink = preg_replace("/(http[s]{0,1}:\/\/){0,1}(www\.){0,1}/si", "", $this->anzeigeLink); - $this->descr = strip_tags(trim($descr), '<p>'); + $this->descr = $this->sanitizeText(strip_tags(trim($descr), '<p>')); $this->descr = preg_replace("/\n+/si", " ", $this->descr); $this->longDescr = $this->descr; if (strlen($this->descr) > self::DESCRIPTION_LENGTH) { @@ -467,4 +467,46 @@ class Result return $string; } + + /** + * Sanitizes bold or special looking UTF-8 characters + * and replaces them with normal looking ones. + * Thanks to: + * https://stackoverflow.com/questions/42254276/how-to-convert-strange-strong-bold-unicode-to-non-bold-utf-8-chars-in-php/63068771#63068771 + * $text => The text to sanitize + * + * @return Sanitized version of the text + */ + private function sanitizeText($text){ + $target = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"]; + $specialList = [ + 'serifBold' => ['ðš', 'ð›', 'ðœ', 'ð', 'ðž', 'ðŸ', 'ð ', 'ð¡', 'ð¢', 'ð£', 'ð¤', 'ð¥', 'ð¦', 'ð§', 'ð¨', 'ð©', 'ðª', 'ð«', 'ð¬', 'ð', 'ð®', 'ð¯', 'ð°', 'ð±', 'ð²', 'ð³', 'ð€', 'ð', 'ð‚', 'ðƒ', 'ð„', 'ð…', 'ð†', 'ð‡', 'ðˆ', 'ð‰', 'ðŠ', 'ð‹', 'ðŒ', 'ð', 'ðŽ', 'ð', 'ð', 'ð‘', 'ð’', 'ð“', 'ð”', 'ð•', 'ð–', 'ð—', 'ð˜', 'ð™', 'ðŸŽ', 'ðŸ', 'ðŸ', 'ðŸ‘', 'ðŸ’', 'ðŸ“', 'ðŸ”', 'ðŸ•', 'ðŸ–', 'ðŸ—', 'â—', 'â“', '.', ',', '"', "'"], + 'serifItalic' => ['ð‘Ž', 'ð‘', 'ð‘', 'ð‘‘', 'ð‘’', 'ð‘“', 'ð‘”', 'â„Ž', 'ð‘–', 'ð‘—', 'ð‘˜', 'ð‘™', 'ð‘š', 'ð‘›', 'ð‘œ', 'ð‘', 'ð‘ž', 'ð‘Ÿ', 'ð‘ ', 'ð‘¡', 'ð‘¢', 'ð‘£', 'ð‘¤', 'ð‘¥', 'ð‘¦', 'ð‘§', 'ð´', 'ðµ', 'ð¶', 'ð·', 'ð¸', 'ð¹', 'ðº', 'ð»', 'ð¼', 'ð½', 'ð¾', 'ð¿', 'ð‘€', 'ð‘', 'ð‘‚', 'ð‘ƒ', 'ð‘„', 'ð‘…', 'ð‘†', 'ð‘‡', 'ð‘ˆ', 'ð‘‰', 'ð‘Š', 'ð‘‹', 'ð‘Œ', 'ð‘', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'serifBoldItalic' => ['ð’‚', 'ð’ƒ', 'ð’„', 'ð’…', 'ð’†', 'ð’‡', 'ð’ˆ', 'ð’‰', 'ð’Š', 'ð’‹', 'ð’Œ', 'ð’', 'ð’Ž', 'ð’', 'ð’', 'ð’‘', 'ð’’', 'ð’“', 'ð’”', 'ð’•', 'ð’–', 'ð’—', 'ð’˜', 'ð’™', 'ð’š', 'ð’›', 'ð‘¨', 'ð‘©', 'ð‘ª', 'ð‘«', 'ð‘¬', 'ð‘', 'ð‘®', 'ð‘¯', 'ð‘°', 'ð‘±', 'ð‘²', 'ð‘³', 'ð‘´', 'ð‘µ', 'ð‘¶', 'ð‘·', 'ð‘¸', 'ð‘¹', 'ð‘º', 'ð‘»', 'ð‘¼', 'ð‘½', 'ð‘¾', 'ð‘¿', 'ð’€', 'ð’', 'ðŸŽ', 'ðŸ', 'ðŸ', 'ðŸ‘', 'ðŸ’', 'ðŸ“', 'ðŸ”', 'ðŸ•', 'ðŸ–', 'ðŸ—', 'â—', 'â“', '.', ',', '"', "'"], + 'sans' => ['ð–º', 'ð–»', 'ð–¼', 'ð–½', 'ð–¾', 'ð–¿', 'ð—€', 'ð—', 'ð—‚', 'ð—ƒ', 'ð—„', 'ð—…', 'ð—†', 'ð—‡', 'ð—ˆ', 'ð—‰', 'ð—Š', 'ð—‹', 'ð—Œ', 'ð—', 'ð—Ž', 'ð—', 'ð—', 'ð—‘', 'ð—’', 'ð—“', 'ð– ', 'ð–¡', 'ð–¢', 'ð–£', 'ð–¤', 'ð–¥', 'ð–¦', 'ð–§', 'ð–¨', 'ð–©', 'ð–ª', 'ð–«', 'ð–¬', 'ð–', 'ð–®', 'ð–¯', 'ð–°', 'ð–±', 'ð–²', 'ð–³', 'ð–´', 'ð–µ', 'ð–¶', 'ð–·', 'ð–¸', 'ð–¹', 'ðŸ¢', 'ðŸ£', 'ðŸ¤', 'ðŸ¥', 'ðŸ¦', 'ðŸ§', 'ðŸ¨', 'ðŸ©', 'ðŸª', 'ðŸ«', '!', '?', '.', ',', '"', "'"], + 'sansBold' => ['ð—®', 'ð—¯', 'ð—°', 'ð—±', 'ð—²', 'ð—³', 'ð—´', 'ð—µ', 'ð—¶', 'ð—·', 'ð—¸', 'ð—¹', 'ð—º', 'ð—»', 'ð—¼', 'ð—½', 'ð—¾', 'ð—¿', 'ð˜€', 'ð˜', 'ð˜‚', 'ð˜ƒ', 'ð˜„', 'ð˜…', 'ð˜†', 'ð˜‡', 'ð—”', 'ð—•', 'ð—–', 'ð——', 'ð—˜', 'ð—™', 'ð—š', 'ð—›', 'ð—œ', 'ð—', 'ð—ž', 'ð—Ÿ', 'ð— ', 'ð—¡', 'ð—¢', 'ð—£', 'ð—¤', 'ð—¥', 'ð—¦', 'ð—§', 'ð—¨', 'ð—©', 'ð—ª', 'ð—«', 'ð—¬', 'ð—', 'ðŸ¬', 'ðŸ', 'ðŸ®', 'ðŸ¯', 'ðŸ°', 'ðŸ±', 'ðŸ²', 'ðŸ³', 'ðŸ´', 'ðŸµ', 'â—', 'â“', '.', ',', '"', "'"], + 'sansItalic' => ['ð˜¢', 'ð˜£', 'ð˜¤', 'ð˜¥', 'ð˜¦', 'ð˜§', 'ð˜¨', 'ð˜©', 'ð˜ª', 'ð˜«', 'ð˜¬', 'ð˜', 'ð˜®', 'ð˜¯', 'ð˜°', 'ð˜±', 'ð˜²', 'ð˜³', 'ð˜´', 'ð˜µ', 'ð˜¶', 'ð˜·', 'ð˜¸', 'ð˜¹', 'ð˜º', 'ð˜»', 'ð˜ˆ', 'ð˜‰', 'ð˜Š', 'ð˜‹', 'ð˜Œ', 'ð˜', 'ð˜Ž', 'ð˜', 'ð˜', 'ð˜‘', 'ð˜’', 'ð˜“', 'ð˜”', 'ð˜•', 'ð˜–', 'ð˜—', 'ð˜˜', 'ð˜™', 'ð˜š', 'ð˜›', 'ð˜œ', 'ð˜', 'ð˜ž', 'ð˜Ÿ', 'ð˜ ', 'ð˜¡', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'sansBoldItalic' => ['ð™–', 'ð™—', 'ð™˜', 'ð™™', 'ð™š', 'ð™›', 'ð™œ', 'ð™', 'ð™ž', 'ð™Ÿ', 'ð™ ', 'ð™¡', 'ð™¢', 'ð™£', 'ð™¤', 'ð™¥', 'ð™¦', 'ð™§', 'ð™¨', 'ð™©', 'ð™ª', 'ð™«', 'ð™¬', 'ð™', 'ð™®', 'ð™¯', 'ð˜¼', 'ð˜½', 'ð˜¾', 'ð˜¿', 'ð™€', 'ð™', 'ð™‚', 'ð™ƒ', 'ð™„', 'ð™…', 'ð™†', 'ð™‡', 'ð™ˆ', 'ð™‰', 'ð™Š', 'ð™‹', 'ð™Œ', 'ð™', 'ð™Ž', 'ð™', 'ð™', 'ð™‘', 'ð™’', 'ð™“', 'ð™”', 'ð™•', 'ðŸŽ', 'ðŸ', 'ðŸ', 'ðŸ‘', 'ðŸ’', 'ðŸ“', 'ðŸ”', 'ðŸ•', 'ðŸ–', 'ðŸ—', 'â—', 'â“', '.', ',', '"', "'"], + 'script' => ['ð’¶', 'ð’·', 'ð’¸', 'ð’¹', 'ℯ', 'ð’»', 'â„Š', 'ð’½', 'ð’¾', 'ð’¿', 'ð“€', 'ð“', 'ð“‚', 'ð“ƒ', 'â„´', 'ð“…', 'ð“†', 'ð“‡', 'ð“ˆ', 'ð“‰', 'ð“Š', 'ð“‹', 'ð“Œ', 'ð“', 'ð“Ž', 'ð“', 'ð’œ', 'ℬ', 'ð’ž', 'ð’Ÿ', 'â„°', 'ℱ', 'ð’¢', 'â„‹', 'â„', 'ð’¥', 'ð’¦', 'â„’', 'ℳ', 'ð’©', 'ð’ª', 'ð’«', 'ð’¬', 'â„›', 'ð’®', 'ð’¯', 'ð’°', 'ð’±', 'ð’²', 'ð’³', 'ð’´', 'ð’µ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'scriptBold' => ['ð“ª', 'ð“«', 'ð“¬', 'ð“', 'ð“®', 'ð“¯', 'ð“°', 'ð“±', 'ð“²', 'ð“³', 'ð“´', 'ð“µ', 'ð“¶', 'ð“·', 'ð“¸', 'ð“¹', 'ð“º', 'ð“»', 'ð“¼', 'ð“½', 'ð“¾', 'ð“¿', 'ð”€', 'ð”', 'ð”‚', 'ð”ƒ', 'ð“', 'ð“‘', 'ð“’', 'ð““', 'ð“”', 'ð“•', 'ð“–', 'ð“—', 'ð“˜', 'ð“™', 'ð“š', 'ð“›', 'ð“œ', 'ð“', 'ð“ž', 'ð“Ÿ', 'ð“ ', 'ð“¡', 'ð“¢', 'ð“£', 'ð“¤', 'ð“¥', 'ð“¦', 'ð“§', 'ð“¨', 'ð“©', 'ðŸŽ', 'ðŸ', 'ðŸ', 'ðŸ‘', 'ðŸ’', 'ðŸ“', 'ðŸ”', 'ðŸ•', 'ðŸ–', 'ðŸ—', 'â—', 'â“', '.', ',', '"', "'"], + 'fraktur' => ['ð”ž', 'ð”Ÿ', 'ð” ', 'ð”¡', 'ð”¢', 'ð”£', 'ð”¤', 'ð”¥', 'ð”¦', 'ð”§', 'ð”¨', 'ð”©', 'ð”ª', 'ð”«', 'ð”¬', 'ð”', 'ð”®', 'ð”¯', 'ð”°', 'ð”±', 'ð”²', 'ð”³', 'ð”´', 'ð”µ', 'ð”¶', 'ð”·', 'ð”„', 'ð”…', 'â„', 'ð”‡', 'ð”ˆ', 'ð”‰', 'ð”Š', 'â„Œ', 'â„‘', 'ð”', 'ð”Ž', 'ð”', 'ð”', 'ð”‘', 'ð”’', 'ð”“', 'ð””', 'â„œ', 'ð”–', 'ð”—', 'ð”˜', 'ð”™', 'ð”š', 'ð”›', 'ð”œ', 'ℨ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'frakturBold' => ['ð–†', 'ð–‡', 'ð–ˆ', 'ð–‰', 'ð–Š', 'ð–‹', 'ð–Œ', 'ð–', 'ð–Ž', 'ð–', 'ð–', 'ð–‘', 'ð–’', 'ð–“', 'ð–”', 'ð–•', 'ð––', 'ð–—', 'ð–˜', 'ð–™', 'ð–š', 'ð–›', 'ð–œ', 'ð–', 'ð–ž', 'ð–Ÿ', 'ð•¬', 'ð•', 'ð•®', 'ð•¯', 'ð•°', 'ð•±', 'ð•²', 'ð•³', 'ð•´', 'ð•µ', 'ð•¶', 'ð•·', 'ð•¸', 'ð•¹', 'ð•º', 'ð•»', 'ð•¼', 'ð•½', 'ð•¾', 'ð•¿', 'ð–€', 'ð–', 'ð–‚', 'ð–ƒ', 'ð–„', 'ð–…', 'ðŸŽ', 'ðŸ', 'ðŸ', 'ðŸ‘', 'ðŸ’', 'ðŸ“', 'ðŸ”', 'ðŸ•', 'ðŸ–', 'ðŸ—', 'â—', 'â“', '.', ',', '"', "'"], + 'monospace' => ['ðšŠ', 'ðš‹', 'ðšŒ', 'ðš', 'ðšŽ', 'ðš', 'ðš', 'ðš‘', 'ðš’', 'ðš“', 'ðš”', 'ðš•', 'ðš–', 'ðš—', 'ðš˜', 'ðš™', 'ðšš', 'ðš›', 'ðšœ', 'ðš', 'ðšž', 'ðšŸ', 'ðš ', 'ðš¡', 'ðš¢', 'ðš£', 'ð™°', 'ð™±', 'ð™²', 'ð™³', 'ð™´', 'ð™µ', 'ð™¶', 'ð™·', 'ð™¸', 'ð™¹', 'ð™º', 'ð™»', 'ð™¼', 'ð™½', 'ð™¾', 'ð™¿', 'ðš€', 'ðš', 'ðš‚', 'ðšƒ', 'ðš„', 'ðš…', 'ðš†', 'ðš‡', 'ðšˆ', 'ðš‰', 'ðŸ¶', 'ðŸ·', 'ðŸ¸', 'ðŸ¹', 'ðŸº', 'ðŸ»', 'ðŸ¼', 'ðŸ½', 'ðŸ¾', 'ðŸ¿', 'ï¼', '?', '.', ',', '"', '''], + 'fullwidth' => ['ï½', 'b', 'c', 'd', 'ï½…', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'ï½', 'n', 'ï½', 'ï½', 'q', 'ï½’', 's', 'ï½”', 'u', 'ï½–', 'ï½—', 'x', 'ï½™', 'z', 'A', 'ï¼¢', 'ï¼£', 'D', 'ï¼¥', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'ï¼', 'ï¼®', 'O', 'ï¼°', 'ï¼±', 'ï¼²', 'ï¼³', 'ï¼´', 'ï¼µ', 'V', 'ï¼·', 'X', 'ï¼¹', 'Z', 'ï¼', '1', 'ï¼’', '3', 'ï¼”', '5', 'ï¼–', 'ï¼—', '8', 'ï¼™', 'ï¼', '?', '.', ',', '"', '''], + 'doublestruck' => ['ð•’', 'ð•“', 'ð•”', 'ð••', 'ð•–', 'ð•—', 'ð•˜', 'ð•™', 'ð•š', 'ð•›', 'ð•œ', 'ð•', 'ð•ž', 'ð•Ÿ', 'ð• ', 'ð•¡', 'ð•¢', 'ð•£', 'ð•¤', 'ð•¥', 'ð•¦', 'ð•§', 'ð•¨', 'ð•©', 'ð•ª', 'ð•«', 'ð”¸', 'ð”¹', 'â„‚', 'ð”»', 'ð”¼', 'ð”½', 'ð”¾', 'â„', 'ð•€', 'ð•', 'ð•‚', 'ð•ƒ', 'ð•„', 'â„•', 'ð•†', 'â„™', 'â„š', 'â„', 'ð•Š', 'ð•‹', 'ð•Œ', 'ð•', 'ð•Ž', 'ð•', 'ð•', 'ℤ', 'ðŸ˜', 'ðŸ™', 'ðŸš', 'ðŸ›', 'ðŸœ', 'ðŸ', 'ðŸž', 'ðŸŸ', 'ðŸ ', 'ðŸ¡', 'â•', 'â”', '.', ',', '"', "'"], + 'capitalized' => ['á´€', 'Ê™', 'á´„', 'á´…', 'á´‡', 'ꜰ', 'É¢', 'Êœ', 'ɪ', 'á´Š', 'á´‹', 'ÊŸ', 'á´', 'É´', 'á´', 'á´˜', 'q', 'Ê€', 'ꜱ', 'á´›', 'á´œ', 'á´ ', 'á´¡', 'x', 'Ê', 'á´¢', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'ï¹—', 'ï¹–', 'ï¹’', 'ï¹', '"', "'"], + //'circled' => ['â“', 'â“‘', 'â“’', 'â““', 'â“”', 'â“•', 'â“–', 'â“—', 'ⓘ', 'â“™', 'â“š', 'â“›', 'â“œ', 'â“', 'â“ž', 'â“Ÿ', 'â“ ', 'â“¡', 'â“¢', 'â“£', 'ⓤ', 'â“¥', 'ⓦ', 'ⓧ', 'ⓨ', 'â“©', 'â’¶', 'â’·', 'â’¸', 'â’¹', 'â’º', 'â’»', 'â’¼', 'â’½', 'â’¾', 'â’¿', 'â“€', 'â“', 'â“‚', 'Ⓝ', 'â“„', 'â“…', 'Ⓠ', 'Ⓡ', 'Ⓢ', 'Ⓣ', 'â“Š', 'â“‹', 'â“Œ', 'â“', 'â“Ž', 'â“', '⓪', 'â‘ ', 'â‘¡', 'â‘¢', 'â‘£', '⑤', 'â‘¥', '⑦', '⑧', '⑨', '!', '?', '.', ',', '"', "'"], + //'parenthesized' => ['â’œ', 'â’', 'â’ž', 'â’Ÿ', 'â’ ', 'â’¡', 'â’¢', 'â’£', 'â’¤', 'â’¥', 'â’¦', 'â’§', 'â’¨', 'â’©', 'â’ª', 'â’«', 'â’¬', 'â’', 'â’®', 'â’¯', 'â’°', 'â’±', 'â’²', 'â’³', 'â’´', 'â’µ', 'ðŸ„', '🄑', '🄒', '🄓', '🄔', '🄕', '🄖', '🄗', '🄘', '🄙', '🄚', '🄛', '🄜', 'ðŸ„', '🄞', '🄟', '🄠', '🄡', '🄢', '🄣', '🄤', '🄥', '🄦', '🄧', '🄨', '🄩', 'â“¿', 'â‘´', '⑵', '⑶', 'â‘·', '⑸', '⑹', '⑺', 'â‘»', '⑼', '!', '?', '.', ',', '"', "'"], + 'underlinedSingle' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'underlinedDouble' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'strikethroughSingle' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + 'crosshatch' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '?', '.', ',', '"', "'"], + ]; + + foreach ($specialList as $list) { + $text = str_replace($list, $target, $text); + } + + return $text; + } } diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 11157b054c57ce716155708d0ccdad14e06410b7..2ada99a0eac36cbea1cf0b3b6c1d247cac7180c7 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -45,24 +45,12 @@ spec: imagePullSecrets: {{ toYaml .Values.image.secrets | indent 10 }} volumes: + - name: secrets + secret: + secretName: {{ .Values.application.secretName }} - name: mglogs-persistent-storage persistentVolumeClaim: claimName: mg-logs - - name: env-files - secret: - secretName: metager-env - - name: sumas - secret: - secretName: metager-sumas - - name: sumas-en - secret: - secretName: metager-sumas-en - - name: blacklist - secret: - secretName: metager-blacklist - - name: blacklist-ad - secret: - secretName: metager-ad-blacklist - name: metager-config configMap: name: metager @@ -105,41 +93,37 @@ spec: - name: mglogs-persistent-storage mountPath: /html/storage/logs/metager readOnly: false - - name: env-files + - name: secrets mountPath: /root/.env - subPath: .env + subPath: env readOnly: true - - name: env-files + - name: secrets mountPath: /html/database/seeds/UsersSeeder.php - subPath: UsersSeeder.php - readOnly: true - - name: env-files - mountPath: /html/config/spam.txt - subPath: spam.txt + subPath: userseeder readOnly: true - - name: sumas + - name: secrets mountPath: /html/config/sumas.json - subPath: sumas.json + subPath: sumas readOnly: true - - name: sumas-en + - name: secrets mountPath: /html/config/sumasEn.json - subPath: sumasEn.json + subPath: sumasen readOnly: true - - name: blacklist + - name: secrets mountPath: /html/config/blacklistUrl.txt - subPath: blacklistUrl.txt + subPath: blacklisturl readOnly: true - - name: blacklist + - name: secrets mountPath: /html/config/blacklistDomains.txt - subPath: blacklistDomains.txt + subPath: blacklistdomains readOnly: true - - name: blacklist-ad + - name: secrets mountPath: /html/config/adBlacklistUrl.txt - subPath: adBlacklistUrl.txt + subPath: adblacklisturl readOnly: true - - name: blacklist-ad + - name: secrets mountPath: /html/config/adBlacklistDomains.txt - subPath: adBlacklistDomains.txt + subPath: adblacklistdomains readOnly: true resources: {{ toYaml .Values.resourcesPhpfpm | indent 12 }} @@ -220,9 +204,9 @@ spec: command: ["su"] args: ["-s", "/bin/sh", "-c", "php artisan requests:fetcher", "nginx"] volumeMounts: - - name: env-files + - name: secrets mountPath: /html/.env - subPath: .env + subPath: env readOnly: true imagePullPolicy: {{ .Values.image.pullPolicy }} livenessProbe: