[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.142.199.54: ~ $
<?php declare(strict_types = 1);

namespace MailPoet\Captcha;

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


use MailPoet\Form\AssetsController;
use MailPoet\WP\Functions as WPFunction;

class PageRenderer {
  private array $data = [];
  private WPFunction $wp;
  private CaptchaFormRenderer $formRenderer;
  private AssetsController $assetsController;

  public function __construct(
    WPFunction $wp,
    CaptchaFormRenderer $formRenderer,
    AssetsController $assetsController
  ) {
    $this->wp = $wp;
    $this->formRenderer = $formRenderer;
    $this->assetsController = $assetsController;
  }

  public function render($data) {
    $this->data = $data;
    $this->wp->addFilter('wp_title', [$this, 'setWindowTitle'], 10, 3);
    $this->wp->addFilter('document_title_parts', [$this, 'setWindowTitleParts']);
    $this->wp->removeAction('wp_head', 'noindex', 1);
    $this->wp->addAction('wp_head', [$this, 'setMetaRobots'], 1);
    $this->wp->addFilter('the_title', [$this, 'setPageTitle']);
    $this->wp->addFilter('the_content', [$this, 'setPageContent']);
  }

  public function setWindowTitle($title, $separator, $separatorLocation = 'right') {
    $titleParts = explode(" $separator ", $title);
    if (!is_array($titleParts)) {
      return $title;
    }

    if ($separatorLocation === 'right') {
      // first part
      $titleParts[0] = $this->setPageTitle();
    } else {
      // last part
      $lastIndex = count($titleParts) - 1;
      $titleParts[$lastIndex] = $this->setPageTitle();
    }

    return implode(" $separator ", $titleParts);
  }

  public function setWindowTitleParts($meta = []) {
    $meta['title'] = $this->setPageTitle();
    return $meta;
  }

  public function setMetaRobots() {
    echo '<meta name="robots" content="noindex,nofollow">';
  }

  public function setPageTitle() {
    return __("Confirm you’re not a robot", 'mailpoet');
  }

  public function setPageContent($pageContent) {
    $this->assetsController->setupFrontEndDependencies();

    $content = $this->formRenderer->render($this->data);
    if (!$content) {
      return false;
    }

    return str_replace('[mailpoet_page]', trim($content), $pageContent);
  }
}

Filemanager

Name Type Size Permission Actions
Validator Folder 0755
CaptchaConstants.php File 664 B 0644
CaptchaFormRenderer.php File 8.26 KB 0644
CaptchaHooks.php File 3 KB 0644
CaptchaPhrase.php File 891 B 0644
CaptchaRenderer.php File 2.35 KB 0644
CaptchaSession.php File 1.63 KB 0644
CaptchaUrlFactory.php File 1.88 KB 0644
PageRenderer.php File 2.12 KB 0644
ReCaptchaRenderer.php File 1.08 KB 0644
ReCaptchaValidator.php File 1.67 KB 0644
index.php File 6 B 0644