Try to convert to plaintext

@param   string  $source
@return  string  Plaintext string
961244
protected function _decode($source)
    {
        // entity decode
        $trans_tbl = get_html_translation_table(HTML_ENTITIES);
        foreach ($trans_tbl as $k => $v) {
            $ttr[$v] = utf8_encode($k);
        }
        $source = strtr($source, $ttr);

        // convert decimal
        //$source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
        $source = preg_replace_callback(
                       '/&#(\d+);/m',
                       function ($m) {
                           return chr($m[1]);
                       },
                       $source
        );

        // convert hex
        //$source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
        
        $source = preg_replace_callback(
                       '/&#x([a-f0-9]+);/mi',
                       function ($m) {
                           return chr('0x'.$m[1]);
                       },
                       $source
        );
        
        return $source;
    }
1304999
protected function getMatches($source)
    {
        if ($this->hasMatches($source)) {
            preg_match_all($this->pattern, $source, $matches, PREG_SET_ORDER);

            return $matches;
        }
    }
410653
public function getCompiledFile($source)
    {
        if (strpos($source, $root = $this->alias->get('@root')) === 0) {
            $compiled = '@data/sword' . substr($source, strlen($root));
        } elseif (!empty($_SERVER['DOCUMENT_ROOT']) && strpos($source, $_SERVER['DOCUMENT_ROOT']) === 0) {
            $compiled = '@data/sword/' . substr($source, strlen($_SERVER['DOCUMENT_ROOT']));
        } else {
            $compiled = "@data/sword/$source";
            if (DIRECTORY_SEPARATOR === '\\') {
                $compiled = str_replace(':', '_', $compiled);
            }
        }

        $compiled = $this->alias->resolve($compiled);

        if ($this->configure->debug || !file_exists($compiled) || filemtime($source) > filemtime($compiled)) {
            $this->swordCompiler->compileFile($source, $compiled);
        }

        return $compiled;
    }
1277229
protected function toStream($source)
    {
        if (is_string($source)) {
            $source = Psr7\try_fopen($source, 'r+');
        }

        return Psr7\stream_for($source);
    }
459473
function encrypt($plaintext)
    {
        if ($this->engine == CRYPT_ENGINE_OPENSSL) {
            $temp = $this->key;
            $this->key = $this->orig_key;
            $result = parent::encrypt($plaintext);
            $this->key = $temp;
            return $result;
        }

        return parent::encrypt($plaintext);
    }
1044999
public function readSource($source)
    {
        $document = new \DOMDocument();
        $errorToExceptionContext = new ErrorToExceptionContext(E_WARNING, function () use ($source, $document) {
            $document->loadXML($source);
        });
        $errorToExceptionContext->invoke();

        return $this->readDocument($document);
    }
291398
public function get_file_reference($source) {
        // Internally we store serialized value but user input is json-encoded for security reasons.
        $ref = json_decode(base64_decode($source));
        $filename  = clean_param($ref->filename, PARAM_FILE);
        $url = clean_param($ref->url, PARAM_URL);
        return base64_encode(serialize((object)array('url' => $url, 'filename' => $filename)));
    }
1128322
public static function getRealInput($source = 'post') {
		$pairs = explode ( "&", strtolower ( $source ) === 'get' ? $_SERVER ['QUERY_STRING']:file_get_contents ( "php://input" )  );
		$vars = array ();
		foreach ( $pairs as $pair ) {
			$nv = explode ( "=", $pair );
			$name = urldecode ( $nv [0] );
			$value = urldecode ( $nv [1] ?? '');
			$vars [$name] = $value;
		}
		return $vars;
	}
1257890
private function parseHTML($source)
    {
        $DOMDocument = new \DOMDocument();

        // Has inline script element
        if (preg_match_all('/<script((?:(?!src=).)*?)>(.*?)<\/script>/smix', $source, $matches)) {
            if (isset($matches[ 2 ])) {
                foreach ($matches[ 2 ] as $match) {
                    $script = trim($match);
                    $this->bodyScriptContent[ md5($script) ] = $script . PHP_EOL;
                }
            }
        }

        // Remove all inline script first
        $source = preg_replace('/<script((?:(?!src=).)*?)>(.*?)<\/script>/smix', '', $source);

        $DOMDocument->loadHTML($source);

        $DOMXPath = new \DOMXPath($DOMDocument);
        $metas = $DOMXPath->query('//meta');
        foreach ($metas as $meta) {
            $attributes = [];
            foreach ($meta->attributes as $name => $attribute) {
                $attributes[ $name ] = $attribute->nodeValue;
            }

            $this->metaNodes->createElement($attributes);
        }

        $source = preg_replace('#<meta(.*?)>#is', '', $source); // clean up all inline meta tags

        $links = $DOMXPath->query('//link'); // find all inline link tags
        foreach ($links as $link) {
            $attributes = [];
            foreach ($link->attributes as $name => $attribute) {
                $attributes[ $name ] = $attribute->nodeValue;
            }

            $this->linkNodes->createElement($attributes);
        }

        $source = preg_replace('#<link(.*?)>#is', '', $source); // clean up all inline meta tags

        $scripts = $DOMXPath->query('//head/script'); // find all inline script tags
        foreach ($scripts as $script) {
            $attributes = [];
            foreach ($script->attributes as $name => $attribute) {
                $attributes[ $name ] = $attribute->nodeValue;
            }
        }

        $scripts = $DOMXPath->query('//body/script'); // find all inline script tags
        foreach ($scripts as $script) {
            $attributes = [];
            foreach ($script->attributes as $name => $attribute) {
                $attributes[ $name ] = $attribute->nodeValue;
            }

            if ($script->textContent == '') {
                $this->bodyScriptNodes->createElement($attributes);
            }
        }

        $source = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $source);

        // Has inline style Element
        if (preg_match_all('/((<[\\s\\/]*style\\b[^>]*>)([^>]*)(<\\/style>))/i', $source, $matches)) {
            if (isset($matches[ 3 ])) {
                foreach ($matches[ 3 ] as $match) {
                    $style = trim($match);
                    $this->styleContent[ md5($style) ] = $style . PHP_EOL;
                }
            }

            $source = preg_replace('#<style(.*?)>(.*?)</style>#is', '', $source);
        }

        $codes = $DOMXPath->query('//code');
        foreach ($codes as $code) {
            if ($code->textContent == '') {
                $code = str_replace(['{{php', '/php}}'], ['<?php', '?>'], $code->textContent);
                $code = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\r\n", $code);
                $source = str_replace($code, htmlentities($code), $source);
            }
        }

        $source = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\r\n", $source);

        return $source;
    }
183624
public function getRedirect($source)
    {
        foreach ($this->redirections as $redirection)
        {
            if(false !== ($wildcardPos = strpos($redirection['source'], '*')))
            {
                if(substr($source, 0, $wildcardPos) == substr($redirection['source'], 0, $wildcardPos))
                {
                    return array(
                        rtrim($redirection['target'], '*') . substr($source, $wildcardPos),
                        $redirection['type']
                    );
                }
            }
            else
            {
                if($source == $redirection['source'])
                {
                    return array($redirection['target'], $redirection['type']);
                }
            }
        }
        return null;
    }
661450
protected function unserialize($source)
    {
        $source = base64_decode($source);
        $result = @unserialize($source);
        if ($result === false && $source !== serialize(false)) {
            throw new \UnexpectedValueException();
        }
        return $result;
    }
710730
public function highlight(string $source): string
    {
        $result = '';
        $previous = [];
        foreach ($this->getTokens($source) as $token) {
            $result .= $this->r->token($token, $previous);
            $previous = $token;
        }

        return $result;
    }
1003273
public static function parse($source) {
        $name = null;
        $value = null;

        if (preg_match_all('@(<\S*?'.'>)@', $source, $matches)) {
            $name = $matches[0][0];
        }
        if (preg_match_all('@\[default: (.*)\]@i', $source, $matches)) {
            $value = $matches[0][1];
        }
        return new static($name, $value);
    }
1267838
protected function encodeArrayName(array $source): string
    {
        $source = $this->encodeArray($source);
        $count = count($source);
        if ($count === 2 || $count === 3) {
            $name = array_pop($source);
            $method = implode('::', $source);
            return sprintf('%s() $%s parameter', $method, $name);
        } else {
            return implode('::', $source);
        }
    }
1134820
public static function get_google_locale($source) {
		$locale = self::parse_source_path('raw.locale', $source);
		if(!$locale) {
			return self::get_smart_locale();
		}
		return str_replace('-', '_', $locale);
	}
505986
private function applyFinalFixes($source)
    {
        $source = implode("\n", $source);
        $source = str_replace("function \\", "function ", $source);
        $source = str_replace("const \\", "const ", $source);
        $source = str_replace("::\\", "::", $source);

        return (string) $source;
    }
1363479
public function encrypt($plaintext) {
		$key = $this->provider->getKey();

		return $this->cipher->encrypt($plaintext, $key);
	}