Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Whoops\Util; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\C..
Decoded Output download
<?php
namespace Whoops\Util; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Cloner\AbstractCloner; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\HtmlDumper; use Whoops\Exception\Frame; class TemplateHelper { private $variables = array(); private $htmlDumper; private $htmlDumperOutput; private $cloner; private $applicationRootPath; public function __construct() { $this->applicationRootPath = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); } public function escape($raw) { $flags = ENT_QUOTES; if (defined("ENT_SUBSTITUTE") && !defined("HHVM_VERSION")) { $flags |= ENT_SUBSTITUTE; } else { $flags |= ENT_IGNORE; } $raw = str_replace(chr(9), " ", $raw); return htmlspecialchars($raw, $flags, "UTF-8"); } public function escapeButPreserveUris($raw) { $escaped = $this->escape($raw); return preg_replace("@([A-z]+?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@", "<a href="$1" target="_blank" rel="noreferrer noopener">$1</a>", $escaped); } public function breakOnDelimiter($delimiter, $s) { $parts = explode($delimiter, $s); foreach ($parts as &$part) { $part = "<span class="delimiter">" . $part . "</span>"; } return implode($delimiter, $parts); } public function shorten($path) { if ($this->applicationRootPath != "/") { $path = str_replace($this->applicationRootPath, "…", $path); } return $path; } private function getDumper() { if (!$this->htmlDumper && class_exists("Symfony\Component\VarDumper\Cloner\VarCloner")) { $this->htmlDumperOutput = new HtmlDumperOutput(); $this->htmlDumper = new HtmlDumper($this->htmlDumperOutput); $styles = array("default" => "color:#FFFFFF; line-height:normal; font:12px "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace !important; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: normal", "num" => "color:#BCD42A", "const" => "color: #4bb1b1;", "str" => "color:#BCD42A", "note" => "color:#ef7c61", "ref" => "color:#A0A0A0", "public" => "color:#FFFFFF", "protected" => "color:#FFFFFF", "private" => "color:#FFFFFF", "meta" => "color:#FFFFFF", "key" => "color:#BCD42A", "index" => "color:#ef7c61"); $this->htmlDumper->setStyles($styles); } return $this->htmlDumper; } public function dump($value) { $dumper = $this->getDumper(); if ($dumper) { if (class_exists("Symfony\Component\VarDumper\Caster\Caster")) { $cloneVar = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE); } else { $cloneVar = $this->getCloner()->cloneVar($value); } $dumper->dump($cloneVar, $this->htmlDumperOutput); $output = $this->htmlDumperOutput->getOutput(); $this->htmlDumperOutput->clear(); return $output; } return htmlspecialchars(print_r($value, true)); } public function dumpArgs(Frame $frame) { if (!$this->getDumper()) { return ''; } $html = ''; $numFrames = count($frame->getArgs()); if ($numFrames > 0) { $html = "<ol class="linenums">"; foreach ($frame->getArgs() as $j => $frameArg) { $html .= "<li>" . $this->dump($frameArg) . "</li>"; } $html .= "</ol>"; } return $html; } public function slug($original) { $slug = str_replace(" ", "-", $original); $slug = preg_replace("/[^\w\d\-\_]/i", '', $slug); return strtolower($slug); } public function render($template, array $additionalVariables = null) { $variables = $this->getVariables(); $variables["tpl"] = $this; if ($additionalVariables !== null) { $variables = array_replace($variables, $additionalVariables); } call_user_func(function () { extract(func_get_arg(1)); require func_get_arg(0); }, $template, $variables); } public function setVariables(array $variables) { $this->variables = $variables; } public function setVariable($variableName, $variableValue) { $this->variables[$variableName] = $variableValue; } public function getVariable($variableName, $defaultValue = null) { return isset($this->variables[$variableName]) ? $this->variables[$variableName] : $defaultValue; } public function delVariable($variableName) { unset($this->variables[$variableName]); } public function getVariables() { return $this->variables; } public function setCloner($cloner) { $this->cloner = $cloner; } public function getCloner() { if (!$this->cloner) { $this->cloner = new VarCloner(); } return $this->cloner; } public function setApplicationRootPath($applicationRootPath) { $this->applicationRootPath = $applicationRootPath; } public function getApplicationRootPath() { return $this->applicationRootPath; } } ?>
Did this file decode correctly?
Original Code
<?php
namespace Whoops\Util; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Cloner\AbstractCloner; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\HtmlDumper; use Whoops\Exception\Frame; class TemplateHelper { private $variables = array(); private $htmlDumper; private $htmlDumperOutput; private $cloner; private $applicationRootPath; public function __construct() { $this->applicationRootPath = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); } public function escape($raw) { $flags = ENT_QUOTES; if (defined("\105\116\124\x5f\x53\x55\102\x53\124\111\124\x55\x54\x45") && !defined("\x48\110\x56\x4d\137\126\105\122\123\111\x4f\116")) { $flags |= ENT_SUBSTITUTE; } else { $flags |= ENT_IGNORE; } $raw = str_replace(chr(9), "\40\x20\40\x20", $raw); return htmlspecialchars($raw, $flags, "\125\124\106\x2d\x38"); } public function escapeButPreserveUris($raw) { $escaped = $this->escape($raw); return preg_replace("\x40\50\x5b\x41\55\172\135\x2b\77\72\57\x2f\50\x5b\55\x5c\167\134\x2e\135\53\x5b\x2d\134\167\135\51\53\x28\x3a\134\144\53\x29\77\x28\x2f\50\133\x5c\167\57\x5f\134\x2e\x23\x2d\135\x2a\50\134\x3f\134\123\53\51\x3f\133\136\x5c\x2e\134\x73\135\x29\77\51\x3f\x29\100", "\74\141\40\x68\x72\145\x66\75\x22\44\x31\42\40\x74\141\x72\147\145\x74\75\x22\x5f\x62\x6c\x61\156\153\x22\40\162\145\x6c\75\42\x6e\x6f\x72\145\146\145\x72\x72\145\162\x20\x6e\157\157\160\145\156\x65\162\42\x3e\44\x31\x3c\x2f\x61\76", $escaped); } public function breakOnDelimiter($delimiter, $s) { $parts = explode($delimiter, $s); foreach ($parts as &$part) { $part = "\74\x73\x70\x61\156\x20\x63\x6c\141\x73\x73\x3d\x22\144\145\x6c\151\x6d\151\x74\145\x72\42\x3e" . $part . "\x3c\57\x73\160\141\x6e\76"; } return implode($delimiter, $parts); } public function shorten($path) { if ($this->applicationRootPath != "\57") { $path = str_replace($this->applicationRootPath, "\x26\150\145\x6c\154\151\x70\73", $path); } return $path; } private function getDumper() { if (!$this->htmlDumper && class_exists("\123\171\x6d\x66\157\x6e\x79\x5c\103\x6f\x6d\160\x6f\156\x65\156\x74\134\x56\x61\162\104\165\155\160\x65\162\134\103\154\x6f\156\145\162\x5c\126\x61\162\103\154\157\x6e\145\162")) { $this->htmlDumperOutput = new HtmlDumperOutput(); $this->htmlDumper = new HtmlDumper($this->htmlDumperOutput); $styles = array("\144\145\146\x61\165\154\164" => "\x63\157\154\x6f\x72\72\43\106\x46\x46\x46\x46\x46\73\40\154\x69\x6e\145\x2d\150\145\151\147\x68\164\72\x6e\157\162\x6d\x61\154\x3b\x20\x66\x6f\156\164\x3a\x31\62\160\x78\40\42\x49\156\x63\x6f\156\x73\157\x6c\x61\x74\x61\42\54\x20\x22\106\151\162\x61\x20\x4d\157\156\x6f\42\54\x20\42\123\157\x75\162\x63\145\x20\x43\157\x64\145\40\x50\x72\157\x22\54\40\115\x6f\x6e\141\143\x6f\54\40\x43\x6f\156\163\157\154\x61\163\x2c\40\42\114\x75\143\x69\x64\141\x20\103\157\156\163\157\154\145\42\x2c\x20\155\x6f\x6e\157\x73\x70\x61\143\145\40\41\x69\155\x70\x6f\x72\x74\141\x6e\164\x3b\x20\167\x6f\162\144\55\x77\162\x61\160\72\40\x62\162\x65\x61\153\55\x77\x6f\162\x64\x3b\x20\x77\x68\x69\x74\x65\x2d\x73\160\x61\x63\x65\x3a\x20\x70\x72\145\55\167\x72\x61\x70\73\x20\x70\x6f\163\x69\164\x69\x6f\156\72\162\x65\154\x61\164\151\166\145\73\x20\x7a\55\x69\156\144\x65\x78\72\x39\x39\x39\x39\x39\x3b\x20\167\157\x72\144\55\x62\162\x65\141\153\72\x20\x6e\157\162\155\x61\x6c", "\156\x75\x6d" => "\143\x6f\x6c\157\162\72\x23\102\103\104\64\62\101", "\x63\157\x6e\x73\164" => "\x63\x6f\154\157\162\x3a\40\43\x34\142\x62\x31\142\61\x3b", "\x73\164\162" => "\143\x6f\x6c\x6f\162\x3a\x23\x42\103\x44\64\62\x41", "\156\157\x74\x65" => "\143\157\154\x6f\162\72\43\145\146\67\x63\66\x31", "\x72\145\146" => "\x63\x6f\154\157\x72\72\x23\x41\x30\x41\60\x41\x30", "\x70\165\142\x6c\151\143" => "\143\157\x6c\157\162\x3a\x23\106\x46\106\x46\x46\x46", "\160\162\x6f\164\145\x63\x74\145\x64" => "\x63\157\154\157\162\x3a\43\x46\x46\106\106\106\x46", "\x70\x72\151\x76\141\x74\145" => "\143\x6f\154\157\162\72\x23\x46\x46\106\106\x46\x46", "\x6d\x65\164\x61" => "\x63\157\154\157\x72\72\43\x46\x46\x46\x46\106\106", "\153\x65\x79" => "\x63\x6f\154\x6f\162\x3a\x23\x42\103\104\64\x32\x41", "\x69\x6e\144\x65\x78" => "\x63\157\x6c\157\162\72\x23\x65\x66\67\x63\66\x31"); $this->htmlDumper->setStyles($styles); } return $this->htmlDumper; } public function dump($value) { $dumper = $this->getDumper(); if ($dumper) { if (class_exists("\x53\x79\155\x66\x6f\156\171\134\x43\157\155\160\x6f\x6e\145\156\x74\x5c\x56\x61\162\x44\165\x6d\x70\145\x72\x5c\103\141\x73\164\145\162\x5c\x43\x61\x73\x74\x65\162")) { $cloneVar = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE); } else { $cloneVar = $this->getCloner()->cloneVar($value); } $dumper->dump($cloneVar, $this->htmlDumperOutput); $output = $this->htmlDumperOutput->getOutput(); $this->htmlDumperOutput->clear(); return $output; } return htmlspecialchars(print_r($value, true)); } public function dumpArgs(Frame $frame) { if (!$this->getDumper()) { return ''; } $html = ''; $numFrames = count($frame->getArgs()); if ($numFrames > 0) { $html = "\x3c\157\x6c\40\143\x6c\141\x73\x73\75\x22\154\x69\156\x65\x6e\165\155\163\x22\76"; foreach ($frame->getArgs() as $j => $frameArg) { $html .= "\x3c\154\x69\x3e" . $this->dump($frameArg) . "\74\57\x6c\x69\76"; } $html .= "\x3c\x2f\157\x6c\76"; } return $html; } public function slug($original) { $slug = str_replace("\x20", "\55", $original); $slug = preg_replace("\57\133\136\x5c\x77\134\x64\134\x2d\134\x5f\135\x2f\x69", '', $slug); return strtolower($slug); } public function render($template, array $additionalVariables = null) { $variables = $this->getVariables(); $variables["\164\x70\154"] = $this; if ($additionalVariables !== null) { $variables = array_replace($variables, $additionalVariables); } call_user_func(function () { extract(func_get_arg(1)); require func_get_arg(0); }, $template, $variables); } public function setVariables(array $variables) { $this->variables = $variables; } public function setVariable($variableName, $variableValue) { $this->variables[$variableName] = $variableValue; } public function getVariable($variableName, $defaultValue = null) { return isset($this->variables[$variableName]) ? $this->variables[$variableName] : $defaultValue; } public function delVariable($variableName) { unset($this->variables[$variableName]); } public function getVariables() { return $this->variables; } public function setCloner($cloner) { $this->cloner = $cloner; } public function getCloner() { if (!$this->cloner) { $this->cloner = new VarCloner(); } return $this->cloner; } public function setApplicationRootPath($applicationRootPath) { $this->applicationRootPath = $applicationRootPath; } public function getApplicationRootPath() { return $this->applicationRootPath; } }
Function Calls
None |
Stats
MD5 | 24b2a79d138d1f7c306b5e59771b888f |
Eval Count | 0 |
Decode Time | 113 ms |