getRecord()->content) > OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["postSizes"]["emojiProcessingLimit"]) return $text; $emojis = \Emoji\detect_emoji($text); $replaced = []; # OVK-113 foreach($emojis as $emoji) { $point = explode("-", strtolower($emoji["hex_str"]))[0]; if(in_array($point, $replaced)) continue; else $replaced[] = $point; $image = "https://abs.twimg.com/emoji/v2/72x72/$point.png"; $image = "$emoji[emoji]isAd() ? "sponsored" : "ugc"; return "$link" . htmlentities($matches[4]); }), $text ); } private function removeZalgo(string $text): string { return preg_replace("%[\x{0300}-\x{036F}]{3,}%Xu", "�", $text); } function getText(bool $html = true): string { $contentColumn = property_exists($this, "overrideContentColumn") ? $this->overrideContentColumn : "content"; $text = htmlentities($this->getRecord()->{$contentColumn}, ENT_DISALLOWED | ENT_XHTML); $proc = iconv_strlen($this->getRecord()->{$contentColumn}) <= OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["postSizes"]["processingLimit"]; if($html) { if($proc) { $rel = $this->isAd() ? "sponsored" : "ugc"; $text = $this->formatLinks($text); $text = preg_replace("%@(id|club)([0-9]++) \(([\p{L} 0-9]+)\)%Xu", "[$1$2|$3]", $text); $text = preg_replace("%@(id|club)([0-9]++)%Xu", "[$1$2|@$1$2]", $text); $text = preg_replace("%\[(id|club)([0-9]++)\|([\p{L} 0-9@]+)\]%Xu", "$3", $text); $text = preg_replace("%(#([\p{L}_-]++[0-9]*[\p{L}_-]*))%Xu", "$1", $text); $text = $this->formatEmojis($text); } $text = $this->removeZalgo($text); $text = nl2br($text); } return $text; } }