REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.34 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Form/Util/FieldNameObfuscator.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Form\Util; if (!defined('ABSPATH')) exit; use MailPoet\WP\Functions as WPFunctions; class FieldNameObfuscator { const OBFUSCATED_FIELD_PREFIX = 'form_field_'; const HASH_LENGTH = 12; /** @var WPFunctions */ private $wp; public function __construct( WPFunctions $wp ) { $this->wp = $wp; } public function obfuscate($name) { $authKey = defined('AUTH_KEY') ? AUTH_KEY : ''; $hash = substr(md5($authKey . $this->wp->homeUrl() . $name), 0, self::HASH_LENGTH); return self::OBFUSCATED_FIELD_PREFIX . base64_encode($hash . '_' . $name); } public function deobfuscate($name) { $decoded = base64_decode(substr($name, strlen(self::OBFUSCATED_FIELD_PREFIX))); return substr($decoded, self::HASH_LENGTH + 1); } public function deobfuscateFormPayload($data) { $result = []; foreach ($data as $key => $value) { $result[$this->deobfuscateField($key)] = $value; } return $result; } private function deobfuscateField($name) { if ($this->wasFieldObfuscated($name)) { return $this->deobfuscate($name); } else { return $name; } } private function wasFieldObfuscated($name) { return strpos($name, FieldNameObfuscator::OBFUSCATED_FIELD_PREFIX) === 0; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CustomFonts.php
2.96 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
Export.php
3.40 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
FieldNameObfuscator.php
1.34 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
Styles.php
9.41 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).