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\Handler; use InvalidArgumentException; use RuntimeException; use S..

Decoded Output download

<?php
 namespace Whoops\Handler; use InvalidArgumentException; use RuntimeException; use Symfony\Component\VarDumper\Cloner\AbstractCloner; use Symfony\Component\VarDumper\Cloner\VarCloner; use UnexpectedValueException; use Whoops\Exception\Formatter; use Whoops\Util\Misc; use Whoops\Util\TemplateHelper; class PrettyPageHandler extends Handler { const EDITOR_SUBLIME = "sublime"; const EDITOR_TEXTMATE = "textmate"; const EDITOR_EMACS = "emacs"; const EDITOR_MACVIM = "macvim"; const EDITOR_PHPSTORM = "phpstorm"; const EDITOR_IDEA = "idea"; const EDITOR_VSCODE = "vscode"; const EDITOR_ATOM = "atom"; const EDITOR_ESPRESSO = "espresso"; const EDITOR_XDEBUG = "xdebug"; const EDITOR_NETBEANS = "netbeans"; private $searchPaths = array(); private $resourceCache = array(); private $customCss = null; private $customJs = null; private $extraTables = array(); private $handleUnconditionally = false; private $pageTitle = "Whoops! There was an error."; private $applicationPaths; private $blacklist = array("_GET" => array(), "_POST" => array(), "_FILES" => array(), "_COOKIE" => array(), "_SESSION" => array(), "_SERVER" => array(), "_ENV" => array()); protected $editor; protected $editors = array("sublime" => "subl://open?url=file://%file&line=%line", "textmate" => "txmt://open?url=file://%file&line=%line", "emacs" => "emacs://open?url=file://%file&line=%line", "macvim" => "mvim://open/?url=file://%file&line=%line", "phpstorm" => "phpstorm://open?file=%file&line=%line", "idea" => "idea://open?file=%file&line=%line", "vscode" => "vscode://file/%file:%line", "atom" => "atom://core/open/file?filename=%file&line=%line", "espresso" => "x-espresso://open?filepath=%file&lines=%line", "netbeans" => "netbeans://open/?f=%file:%line"); protected $templateHelper; public function __construct() { if (ini_get("xdebug.file_link_format") || get_cfg_var("xdebug.file_link_format")) { $this->editors["xdebug"] = function ($file, $line) { return str_replace(array("%f", "%l"), array($file, $line), ini_get("xdebug.file_link_format") ?: get_cfg_var("xdebug.file_link_format")); }; $this->setEditor("xdebug"); } $this->searchPaths[] = __DIR__ . "/../Resources"; $this->blacklist("_SERVER", "PHP_AUTH_PW"); $this->templateHelper = new TemplateHelper(); if (class_exists("Symfony\Component\VarDumper\Cloner\VarCloner")) { $cloner = new VarCloner(); $cloner->addCasters(array("*" => function ($obj, $a, $stub, $isNested, $filter = 0) { $class = $stub->class; $classes = array($class => $class) + class_parents($obj) + class_implements($obj); foreach ($classes as $class) { if (isset(AbstractCloner::$defaultCasters[$class])) { return $a; } } return array(); })); $this->templateHelper->setCloner($cloner); } } public function handle() { if (!$this->handleUnconditionally()) { if (PHP_SAPI === "cli") { if (isset($_ENV["whoops-test"])) { throw new \Exception("Use handleUnconditionally instead of whoops-test" . " environment variable"); } return Handler::DONE; } } $templateFile = $this->getResource("views/layout.html.php"); $cssFile = $this->getResource("css/whoops.base.css"); $zeptoFile = $this->getResource("js/zepto.min.js"); $prismJs = $this->getResource("js/prism.js"); $prismCss = $this->getResource("css/prism.css"); $clipboard = $this->getResource("js/clipboard.min.js"); $jsFile = $this->getResource("js/whoops.base.js"); if ($this->customCss) { $customCssFile = $this->getResource($this->customCss); } if ($this->customJs) { $customJsFile = $this->getResource($this->customJs); } $inspector = $this->getInspector(); $frames = $this->getExceptionFrames(); $code = $this->getExceptionCode(); $vars = array("page_title" => $this->getPageTitle(), "stylesheet" => file_get_contents($cssFile), "zepto" => file_get_contents($zeptoFile), "prismJs" => file_get_contents($prismJs), "prismCss" => file_get_contents($prismCss), "clipboard" => file_get_contents($clipboard), "javascript" => file_get_contents($jsFile), "header" => $this->getResource("views/header.html.php"), "header_outer" => $this->getResource("views/header_outer.html.php"), "frame_list" => $this->getResource("views/frame_list.html.php"), "frames_description" => $this->getResource("views/frames_description.html.php"), "frames_container" => $this->getResource("views/frames_container.html.php"), "panel_details" => $this->getResource("views/panel_details.html.php"), "panel_details_outer" => $this->getResource("views/panel_details_outer.html.php"), "panel_left" => $this->getResource("views/panel_left.html.php"), "panel_left_outer" => $this->getResource("views/panel_left_outer.html.php"), "frame_code" => $this->getResource("views/frame_code.html.php"), "env_details" => $this->getResource("views/env_details.html.php"), "title" => $this->getPageTitle(), "name" => explode("\", $inspector->getExceptionName()), "message" => $inspector->getExceptionMessage(), "previousMessages" => $inspector->getPreviousExceptionMessages(), "docref_url" => $inspector->getExceptionDocrefUrl(), "code" => $code, "previousCodes" => $inspector->getPreviousExceptionCodes(), "plain_exception" => Formatter::formatExceptionPlain($inspector), "frames" => $frames, "has_frames" => !!count($frames), "handler" => $this, "handlers" => $this->getRun()->getHandlers(), "active_frames_tab" => count($frames) && $frames->offsetGet(0)->isApplication() ? "application" : "all", "has_frames_tabs" => $this->getApplicationPaths(), "tables" => array("GET Data" => $this->masked($_GET, "_GET"), "POST Data" => $this->masked($_POST, "_POST"), "Files" => isset($_FILES) ? $this->masked($_FILES, "_FILES") : array(), "Cookies" => $this->masked($_COOKIE, "_COOKIE"), "Session" => isset($_SESSION) ? $this->masked($_SESSION, "_SESSION") : array(), "Server/Request Data" => $this->masked($_SERVER, "_SERVER"), "Environment Variables" => $this->masked($_ENV, "_ENV"))); if (isset($customCssFile)) { $vars["stylesheet"] .= file_get_contents($customCssFile); } if (isset($customJsFile)) { $vars["javascript"] .= file_get_contents($customJsFile); } $extraTables = array_map(function ($table) use($inspector) { return $table instanceof \Closure ? $table($inspector) : $table; }, $this->getDataTables()); $vars["tables"] = array_merge($extraTables, $vars["tables"]); $plainTextHandler = new PlainTextHandler(); $plainTextHandler->setRun($this->getRun()); $plainTextHandler->setException($this->getException()); $plainTextHandler->setInspector($this->getInspector()); $vars["preface"] = "<!--


" . $this->templateHelper->escape($plainTextHandler->generateResponse()) . "\xa\xa\xa

\xa

\xa\xa\xa-->"; $this->templateHelper->setVariables($vars); $this->templateHelper->render($templateFile); return Handler::QUIT; } protected function getExceptionFrames() { $frames = $this->getInspector()->getFrames($this->getRun()->getFrameFilters()); if ($this->getApplicationPaths()) { foreach ($frames as $frame) { foreach ($this->getApplicationPaths() as $path) { if (strpos($frame->getFile(), $path) === 0) { $frame->setApplication(true); break; } } } } return $frames; } protected function getExceptionCode() { $exception = $this->getException(); $code = $exception->getCode(); if ($exception instanceof \ErrorException) { $code = Misc::translateErrorCode($exception->getSeverity()); } return (string) $code; } public function contentType() { return "text/html"; } public function addDataTable($label, array $data) { $this->extraTables[$label] = $data; return $this; } public function addDataTableCallback($label, $callback) { if (!is_callable($callback)) { throw new InvalidArgumentException("Expecting callback argument to be callable"); } $this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use($callback) { try { $result = call_user_func($callback, $inspector); return is_array($result) || $result instanceof \Traversable ? $result : array(); } catch (\Exception $e) { return array(); } }; return $this; } public function getDataTables($label = null) { if ($label !== null) { return isset($this->extraTables[$label]) ? $this->extraTables[$label] : array(); } return $this->extraTables; } public function handleUnconditionally($value = null) { if (func_num_args() == 0) { return $this->handleUnconditionally; } $this->handleUnconditionally = (bool) $value; return $this; } public function addEditor($identifier, $resolver) { $this->editors[$identifier] = $resolver; return $this; } public function setEditor($editor) { if (!is_callable($editor) && !isset($this->editors[$editor])) { throw new InvalidArgumentException("Unknown editor identifier: {$editor}. Known editors:" . implode(",", array_keys($this->editors))); } $this->editor = $editor; return $this; } public function getEditorHref($filePath, $line) { $editor = $this->getEditor($filePath, $line); if (empty($editor)) { return false; } if (!isset($editor["url"]) || !is_string($editor["url"])) { throw new UnexpectedValueException(__METHOD__ . " should always resolve to a string or a valid editor array; got something else instead."); } $editor["url"] = str_replace("%line", rawurlencode($line), $editor["url"]); $editor["url"] = str_replace("%file", rawurlencode($filePath), $editor["url"]); return $editor["url"]; } public function getEditorAjax($filePath, $line) { $editor = $this->getEditor($filePath, $line); if (!isset($editor["ajax"]) || !is_bool($editor["ajax"])) { throw new UnexpectedValueException(__METHOD__ . " should always resolve to a bool; got something else instead."); } return $editor["ajax"]; } protected function getEditor($filePath, $line) { if (!$this->editor || !is_string($this->editor) && !is_callable($this->editor)) { return array(); } if (is_string($this->editor) && isset($this->editors[$this->editor]) && !is_callable($this->editors[$this->editor])) { return array("ajax" => false, "url" => $this->editors[$this->editor]); } if (is_callable($this->editor) || isset($this->editors[$this->editor]) && is_callable($this->editors[$this->editor])) { if (is_callable($this->editor)) { $callback = call_user_func($this->editor, $filePath, $line); } else { $callback = call_user_func($this->editors[$this->editor], $filePath, $line); } if (empty($callback)) { return array(); } if (is_string($callback)) { return array("ajax" => false, "url" => $callback); } return array("ajax" => isset($callback["ajax"]) ? $callback["ajax"] : false, "url" => isset($callback["url"]) ? $callback["url"] : $callback); } return array(); } public function setPageTitle($title) { $this->pageTitle = (string) $title; return $this; } public function getPageTitle() { return $this->pageTitle; } public function addResourcePath($path) { if (!is_dir($path)) { throw new InvalidArgumentException("'{$path}' is not a valid directory"); } array_unshift($this->searchPaths, $path); return $this; } public function addCustomCss($name) { $this->customCss = $name; return $this; } public function addCustomJs($name) { $this->customJs = $name; return $this; } public function getResourcePaths() { return $this->searchPaths; } protected function getResource($resource) { if (isset($this->resourceCache[$resource])) { return $this->resourceCache[$resource]; } foreach ($this->searchPaths as $path) { $fullPath = $path . "/{$resource}"; if (is_file($fullPath)) { $this->resourceCache[$resource] = $fullPath; return $fullPath; } } throw new RuntimeException("Could not find resource '{$resource}' in any resource paths." . "(searched: " . join(", ", $this->searchPaths) . ")"); } public function getResourcesPath() { $allPaths = $this->getResourcePaths(); return end($allPaths) ?: null; } public function setResourcesPath($resourcesPath) { $this->addResourcePath($resourcesPath); return $this; } public function getApplicationPaths() { return $this->applicationPaths; } public function setApplicationPaths(array $applicationPaths) { $this->applicationPaths = $applicationPaths; } public function setApplicationRootPath($applicationRootPath) { $this->templateHelper->setApplicationRootPath($applicationRootPath); } public function blacklist($superGlobalName, $key) { $this->blacklist[$superGlobalName][] = $key; return $this; } public function hideSuperglobalKey($superGlobalName, $key) { return $this->blacklist($superGlobalName, $key); } private function masked($superGlobal, $superGlobalName) { $blacklisted = $this->blacklist[$superGlobalName]; $values = $superGlobal; foreach ($blacklisted as $key) { if (isset($superGlobal[$key])) { $values[$key] = str_repeat("*", is_string($superGlobal[$key]) ? strlen($superGlobal[$key]) : 3); } } return $values; } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace Whoops\Handler; use InvalidArgumentException; use RuntimeException; use Symfony\Component\VarDumper\Cloner\AbstractCloner; use Symfony\Component\VarDumper\Cloner\VarCloner; use UnexpectedValueException; use Whoops\Exception\Formatter; use Whoops\Util\Misc; use Whoops\Util\TemplateHelper; class PrettyPageHandler extends Handler { const EDITOR_SUBLIME = "\163\x75\x62\154\151\155\x65"; const EDITOR_TEXTMATE = "\164\x65\170\x74\155\141\164\145"; const EDITOR_EMACS = "\x65\155\x61\143\163"; const EDITOR_MACVIM = "\x6d\x61\x63\166\x69\x6d"; const EDITOR_PHPSTORM = "\x70\x68\x70\x73\x74\157\x72\x6d"; const EDITOR_IDEA = "\x69\x64\145\x61"; const EDITOR_VSCODE = "\166\x73\143\157\144\145"; const EDITOR_ATOM = "\x61\x74\157\x6d"; const EDITOR_ESPRESSO = "\145\x73\160\162\145\x73\x73\x6f"; const EDITOR_XDEBUG = "\x78\x64\x65\x62\x75\147"; const EDITOR_NETBEANS = "\x6e\x65\164\x62\x65\141\x6e\x73"; private $searchPaths = array(); private $resourceCache = array(); private $customCss = null; private $customJs = null; private $extraTables = array(); private $handleUnconditionally = false; private $pageTitle = "\127\150\x6f\x6f\160\163\41\40\x54\150\x65\162\x65\40\x77\141\163\40\141\156\40\145\x72\162\x6f\162\x2e"; private $applicationPaths; private $blacklist = array("\137\x47\x45\124" => array(), "\x5f\x50\x4f\123\x54" => array(), "\137\x46\x49\x4c\x45\x53" => array(), "\x5f\x43\117\x4f\x4b\x49\105" => array(), "\x5f\x53\105\x53\x53\x49\x4f\116" => array(), "\137\123\105\122\x56\105\x52" => array(), "\137\x45\116\126" => array()); protected $editor; protected $editors = array("\x73\x75\x62\x6c\151\155\145" => "\163\165\x62\x6c\72\x2f\x2f\157\x70\x65\156\x3f\165\162\x6c\75\146\x69\154\145\72\57\57\45\x66\x69\x6c\x65\46\x6c\x69\x6e\145\75\45\x6c\151\x6e\x65", "\x74\145\170\164\155\141\x74\x65" => "\164\170\x6d\164\72\57\57\x6f\160\x65\x6e\77\165\162\154\x3d\x66\151\x6c\x65\x3a\57\57\x25\x66\x69\154\145\46\x6c\x69\156\x65\x3d\45\x6c\151\x6e\145", "\x65\x6d\x61\143\163" => "\145\155\x61\143\163\72\x2f\57\157\160\x65\x6e\77\165\162\154\75\146\x69\154\x65\72\57\x2f\45\146\x69\x6c\145\46\x6c\151\x6e\x65\75\x25\x6c\x69\x6e\145", "\x6d\141\x63\166\151\155" => "\155\166\151\155\72\57\x2f\157\x70\145\x6e\x2f\77\165\x72\x6c\x3d\x66\151\154\145\72\x2f\57\45\146\151\x6c\x65\x26\154\151\156\x65\x3d\x25\154\x69\x6e\145", "\160\x68\x70\x73\x74\x6f\x72\155" => "\160\150\160\163\164\x6f\162\155\72\57\x2f\157\160\x65\156\x3f\x66\x69\x6c\x65\x3d\45\146\151\x6c\x65\x26\154\151\x6e\x65\75\45\x6c\151\x6e\x65", "\151\144\x65\x61" => "\x69\x64\145\x61\x3a\57\57\157\x70\x65\x6e\77\146\x69\154\145\x3d\45\146\x69\154\145\46\x6c\151\156\x65\x3d\45\x6c\x69\x6e\145", "\x76\x73\x63\157\144\x65" => "\x76\x73\x63\x6f\144\145\x3a\x2f\57\146\151\x6c\x65\57\x25\x66\151\x6c\x65\72\45\x6c\151\x6e\x65", "\141\164\x6f\x6d" => "\x61\x74\x6f\x6d\72\57\57\143\157\x72\x65\57\157\160\x65\x6e\x2f\x66\151\x6c\145\77\146\151\x6c\x65\x6e\x61\155\145\x3d\45\146\151\x6c\145\46\154\151\x6e\x65\x3d\45\x6c\151\156\145", "\145\x73\x70\x72\x65\163\163\x6f" => "\170\x2d\145\x73\160\x72\145\163\x73\157\72\57\x2f\157\x70\145\x6e\x3f\x66\x69\154\145\160\141\x74\150\x3d\45\x66\x69\x6c\x65\46\154\x69\x6e\145\163\x3d\x25\154\151\x6e\x65", "\156\145\164\142\145\x61\x6e\163" => "\156\145\x74\142\x65\x61\x6e\x73\72\57\57\157\x70\x65\x6e\57\77\x66\x3d\x25\146\x69\x6c\145\72\x25\x6c\151\x6e\x65"); protected $templateHelper; public function __construct() { if (ini_get("\x78\x64\x65\x62\165\147\x2e\x66\151\154\x65\x5f\x6c\151\156\153\x5f\x66\157\x72\x6d\141\x74") || get_cfg_var("\170\144\145\142\x75\147\56\146\x69\x6c\x65\x5f\x6c\x69\156\153\x5f\146\157\162\x6d\x61\164")) { $this->editors["\170\x64\145\x62\x75\147"] = function ($file, $line) { return str_replace(array("\45\x66", "\45\x6c"), array($file, $line), ini_get("\x78\x64\145\x62\165\147\x2e\x66\151\x6c\145\x5f\154\x69\156\x6b\x5f\x66\x6f\162\155\141\x74") ?: get_cfg_var("\x78\x64\x65\142\x75\x67\56\146\151\154\x65\x5f\154\x69\156\x6b\x5f\x66\157\162\x6d\x61\164")); }; $this->setEditor("\x78\x64\145\x62\165\x67"); } $this->searchPaths[] = __DIR__ . "\57\56\x2e\57\122\x65\163\157\165\x72\143\x65\163"; $this->blacklist("\137\123\105\x52\x56\x45\x52", "\120\x48\x50\x5f\x41\125\124\110\x5f\x50\127"); $this->templateHelper = new TemplateHelper(); if (class_exists("\x53\x79\x6d\146\157\156\171\134\x43\x6f\155\x70\x6f\156\x65\x6e\164\x5c\x56\141\162\104\x75\x6d\x70\x65\x72\134\103\154\157\156\x65\162\134\126\141\x72\x43\x6c\157\156\x65\162")) { $cloner = new VarCloner(); $cloner->addCasters(array("\x2a" => function ($obj, $a, $stub, $isNested, $filter = 0) { $class = $stub->class; $classes = array($class => $class) + class_parents($obj) + class_implements($obj); foreach ($classes as $class) { if (isset(AbstractCloner::$defaultCasters[$class])) { return $a; } } return array(); })); $this->templateHelper->setCloner($cloner); } } public function handle() { if (!$this->handleUnconditionally()) { if (PHP_SAPI === "\x63\154\151") { if (isset($_ENV["\167\150\157\157\x70\163\55\x74\145\x73\x74"])) { throw new \Exception("\x55\x73\x65\x20\150\x61\156\144\x6c\145\x55\156\143\x6f\x6e\144\151\x74\151\157\x6e\141\x6c\x6c\x79\x20\151\x6e\x73\164\145\x61\144\x20\x6f\146\40\167\150\x6f\x6f\x70\163\55\x74\145\163\164" . "\x20\x65\156\166\x69\x72\157\156\155\x65\x6e\x74\x20\x76\141\162\151\x61\x62\x6c\x65"); } return Handler::DONE; } } $templateFile = $this->getResource("\166\151\145\167\x73\57\x6c\141\171\x6f\165\x74\56\x68\164\x6d\154\56\160\x68\160"); $cssFile = $this->getResource("\143\x73\163\57\x77\150\x6f\x6f\160\x73\56\x62\141\163\145\56\143\163\x73"); $zeptoFile = $this->getResource("\152\x73\57\x7a\145\160\x74\157\56\155\151\156\x2e\152\x73"); $prismJs = $this->getResource("\x6a\x73\x2f\x70\x72\x69\163\x6d\56\152\163"); $prismCss = $this->getResource("\143\x73\163\x2f\160\162\x69\163\155\x2e\143\x73\163"); $clipboard = $this->getResource("\x6a\163\x2f\143\x6c\x69\x70\142\157\x61\x72\144\x2e\155\151\x6e\x2e\x6a\x73"); $jsFile = $this->getResource("\x6a\163\x2f\167\x68\x6f\x6f\160\163\56\x62\x61\x73\x65\56\x6a\x73"); if ($this->customCss) { $customCssFile = $this->getResource($this->customCss); } if ($this->customJs) { $customJsFile = $this->getResource($this->customJs); } $inspector = $this->getInspector(); $frames = $this->getExceptionFrames(); $code = $this->getExceptionCode(); $vars = array("\160\141\147\x65\x5f\164\x69\164\154\145" => $this->getPageTitle(), "\x73\x74\171\154\x65\163\x68\x65\x65\x74" => file_get_contents($cssFile), "\x7a\x65\x70\164\x6f" => file_get_contents($zeptoFile), "\160\162\x69\163\155\x4a\163" => file_get_contents($prismJs), "\160\x72\x69\x73\x6d\x43\x73\163" => file_get_contents($prismCss), "\x63\154\x69\160\142\x6f\x61\x72\144" => file_get_contents($clipboard), "\x6a\141\166\x61\163\143\162\x69\160\x74" => file_get_contents($jsFile), "\150\145\x61\x64\145\162" => $this->getResource("\166\x69\145\x77\163\57\150\145\141\144\x65\x72\56\150\164\x6d\x6c\56\160\x68\x70"), "\x68\145\141\x64\145\x72\137\x6f\x75\164\145\162" => $this->getResource("\166\151\x65\x77\x73\x2f\150\145\141\x64\x65\162\x5f\157\x75\164\145\162\56\x68\x74\x6d\154\x2e\160\150\x70"), "\146\x72\x61\155\145\x5f\x6c\151\163\x74" => $this->getResource("\166\151\x65\x77\163\57\x66\162\141\x6d\145\137\x6c\151\x73\x74\56\x68\x74\155\x6c\x2e\x70\150\160"), "\x66\x72\141\x6d\x65\x73\137\144\145\x73\x63\x72\x69\160\x74\x69\x6f\x6e" => $this->getResource("\x76\151\145\x77\x73\57\146\162\141\x6d\145\163\137\x64\x65\163\x63\162\151\x70\164\x69\157\x6e\56\x68\164\155\154\x2e\160\x68\160"), "\x66\x72\x61\x6d\145\x73\x5f\143\x6f\x6e\x74\141\151\x6e\145\x72" => $this->getResource("\166\151\x65\x77\x73\x2f\146\x72\141\155\145\163\x5f\x63\157\x6e\x74\141\151\x6e\x65\162\56\150\164\x6d\154\56\x70\150\160"), "\x70\141\156\145\154\x5f\144\x65\164\x61\x69\x6c\163" => $this->getResource("\166\151\145\x77\x73\57\160\141\156\x65\154\x5f\144\x65\x74\141\x69\x6c\163\x2e\x68\x74\155\x6c\x2e\160\x68\x70"), "\x70\141\x6e\x65\x6c\137\x64\145\x74\141\x69\x6c\163\137\157\x75\164\x65\162" => $this->getResource("\x76\x69\145\x77\163\57\160\141\156\x65\154\x5f\144\145\x74\x61\151\x6c\163\137\157\165\164\145\x72\x2e\150\x74\155\154\56\160\150\x70"), "\160\141\x6e\x65\x6c\x5f\154\145\x66\164" => $this->getResource("\166\x69\x65\x77\x73\x2f\x70\x61\156\x65\x6c\137\x6c\145\146\x74\x2e\x68\164\155\154\x2e\160\150\x70"), "\x70\x61\156\x65\x6c\x5f\x6c\145\146\164\x5f\157\165\164\145\x72" => $this->getResource("\166\x69\x65\167\163\57\x70\x61\x6e\145\154\x5f\x6c\x65\x66\164\x5f\157\165\164\x65\x72\56\x68\x74\x6d\x6c\56\160\x68\160"), "\x66\x72\x61\155\x65\137\x63\157\144\x65" => $this->getResource("\x76\151\x65\x77\163\x2f\146\x72\x61\155\145\137\143\157\144\145\56\x68\x74\155\x6c\x2e\x70\x68\160"), "\x65\x6e\166\137\x64\x65\x74\141\151\154\163" => $this->getResource("\x76\x69\145\167\163\x2f\x65\x6e\x76\x5f\144\145\164\x61\151\154\x73\x2e\150\x74\155\x6c\x2e\160\x68\x70"), "\164\151\164\154\145" => $this->getPageTitle(), "\156\x61\155\x65" => explode("\134", $inspector->getExceptionName()), "\x6d\x65\x73\163\141\x67\x65" => $inspector->getExceptionMessage(), "\x70\162\145\166\x69\x6f\165\x73\115\x65\163\x73\x61\x67\145\x73" => $inspector->getPreviousExceptionMessages(), "\144\x6f\143\x72\x65\x66\x5f\x75\162\x6c" => $inspector->getExceptionDocrefUrl(), "\143\x6f\x64\x65" => $code, "\x70\162\x65\x76\x69\157\x75\x73\x43\x6f\x64\145\163" => $inspector->getPreviousExceptionCodes(), "\x70\154\x61\x69\156\137\x65\170\143\145\160\x74\x69\x6f\156" => Formatter::formatExceptionPlain($inspector), "\146\x72\141\155\145\x73" => $frames, "\x68\141\163\x5f\146\x72\141\x6d\x65\163" => !!count($frames), "\150\x61\156\144\x6c\145\162" => $this, "\x68\141\x6e\x64\x6c\x65\162\x73" => $this->getRun()->getHandlers(), "\x61\143\x74\x69\166\x65\x5f\x66\162\141\x6d\x65\163\x5f\164\141\142" => count($frames) && $frames->offsetGet(0)->isApplication() ? "\141\x70\x70\154\151\x63\x61\x74\151\x6f\156" : "\141\x6c\x6c", "\150\141\163\x5f\x66\x72\x61\x6d\x65\163\x5f\164\141\x62\163" => $this->getApplicationPaths(), "\x74\141\142\x6c\x65\163" => array("\x47\105\124\x20\104\x61\164\141" => $this->masked($_GET, "\137\107\x45\x54"), "\x50\x4f\123\x54\x20\104\x61\164\141" => $this->masked($_POST, "\137\120\x4f\x53\124"), "\x46\x69\154\x65\x73" => isset($_FILES) ? $this->masked($_FILES, "\x5f\x46\111\114\x45\123") : array(), "\x43\x6f\x6f\153\x69\x65\163" => $this->masked($_COOKIE, "\x5f\103\x4f\117\x4b\x49\105"), "\x53\145\163\x73\151\157\x6e" => isset($_SESSION) ? $this->masked($_SESSION, "\x5f\x53\105\x53\123\111\117\116") : array(), "\x53\145\162\166\145\x72\x2f\x52\145\161\x75\x65\163\x74\40\104\141\x74\141" => $this->masked($_SERVER, "\x5f\x53\105\122\126\x45\x52"), "\105\156\166\151\162\157\156\155\145\x6e\x74\40\126\x61\x72\x69\x61\x62\154\145\x73" => $this->masked($_ENV, "\x5f\x45\x4e\x56"))); if (isset($customCssFile)) { $vars["\x73\x74\x79\154\145\x73\150\x65\x65\164"] .= file_get_contents($customCssFile); } if (isset($customJsFile)) { $vars["\152\x61\166\x61\x73\x63\x72\151\x70\164"] .= file_get_contents($customJsFile); } $extraTables = array_map(function ($table) use($inspector) { return $table instanceof \Closure ? $table($inspector) : $table; }, $this->getDataTables()); $vars["\164\x61\x62\x6c\145\x73"] = array_merge($extraTables, $vars["\x74\141\142\x6c\x65\163"]); $plainTextHandler = new PlainTextHandler(); $plainTextHandler->setRun($this->getRun()); $plainTextHandler->setException($this->getException()); $plainTextHandler->setInspector($this->getInspector()); $vars["\160\x72\145\x66\x61\143\145"] = "\x3c\41\55\x2d\12\12\12" . $this->templateHelper->escape($plainTextHandler->generateResponse()) . "\xa\xa\xa\12\12\xa\12\12\xa\xa\xa\55\55\x3e"; $this->templateHelper->setVariables($vars); $this->templateHelper->render($templateFile); return Handler::QUIT; } protected function getExceptionFrames() { $frames = $this->getInspector()->getFrames($this->getRun()->getFrameFilters()); if ($this->getApplicationPaths()) { foreach ($frames as $frame) { foreach ($this->getApplicationPaths() as $path) { if (strpos($frame->getFile(), $path) === 0) { $frame->setApplication(true); break; } } } } return $frames; } protected function getExceptionCode() { $exception = $this->getException(); $code = $exception->getCode(); if ($exception instanceof \ErrorException) { $code = Misc::translateErrorCode($exception->getSeverity()); } return (string) $code; } public function contentType() { return "\164\145\170\x74\x2f\150\164\x6d\x6c"; } public function addDataTable($label, array $data) { $this->extraTables[$label] = $data; return $this; } public function addDataTableCallback($label, $callback) { if (!is_callable($callback)) { throw new InvalidArgumentException("\x45\170\160\x65\x63\x74\151\156\x67\40\x63\141\154\154\142\141\x63\x6b\x20\x61\x72\x67\165\155\145\x6e\164\x20\x74\157\x20\x62\145\40\143\141\x6c\x6c\141\142\154\x65"); } $this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use($callback) { try { $result = call_user_func($callback, $inspector); return is_array($result) || $result instanceof \Traversable ? $result : array(); } catch (\Exception $e) { return array(); } }; return $this; } public function getDataTables($label = null) { if ($label !== null) { return isset($this->extraTables[$label]) ? $this->extraTables[$label] : array(); } return $this->extraTables; } public function handleUnconditionally($value = null) { if (func_num_args() == 0) { return $this->handleUnconditionally; } $this->handleUnconditionally = (bool) $value; return $this; } public function addEditor($identifier, $resolver) { $this->editors[$identifier] = $resolver; return $this; } public function setEditor($editor) { if (!is_callable($editor) && !isset($this->editors[$editor])) { throw new InvalidArgumentException("\x55\156\153\156\157\x77\x6e\40\x65\x64\x69\164\x6f\x72\40\x69\x64\x65\156\x74\x69\146\x69\x65\x72\72\x20{$editor}\56\40\113\156\x6f\167\x6e\x20\145\144\151\x74\157\x72\x73\x3a" . implode("\54", array_keys($this->editors))); } $this->editor = $editor; return $this; } public function getEditorHref($filePath, $line) { $editor = $this->getEditor($filePath, $line); if (empty($editor)) { return false; } if (!isset($editor["\x75\x72\x6c"]) || !is_string($editor["\x75\x72\154"])) { throw new UnexpectedValueException(__METHOD__ . "\40\x73\x68\x6f\165\x6c\144\40\141\154\x77\141\171\x73\40\162\145\163\x6f\x6c\x76\x65\x20\164\x6f\40\x61\40\x73\x74\162\151\156\147\40\x6f\162\x20\141\x20\166\x61\154\151\144\x20\x65\144\151\x74\x6f\x72\x20\x61\162\162\x61\x79\73\x20\147\157\164\x20\x73\157\x6d\145\164\150\151\x6e\x67\40\145\154\x73\145\x20\151\156\x73\164\145\141\x64\x2e"); } $editor["\165\162\x6c"] = str_replace("\45\154\x69\x6e\145", rawurlencode($line), $editor["\x75\x72\154"]); $editor["\x75\162\x6c"] = str_replace("\45\x66\x69\154\x65", rawurlencode($filePath), $editor["\165\x72\154"]); return $editor["\x75\162\154"]; } public function getEditorAjax($filePath, $line) { $editor = $this->getEditor($filePath, $line); if (!isset($editor["\141\152\141\170"]) || !is_bool($editor["\x61\152\x61\x78"])) { throw new UnexpectedValueException(__METHOD__ . "\40\163\150\157\165\154\144\40\141\154\x77\x61\171\163\x20\162\x65\163\x6f\x6c\166\x65\x20\164\x6f\x20\141\40\x62\157\157\154\73\40\x67\157\x74\x20\x73\157\155\x65\x74\150\151\156\147\40\145\x6c\163\145\40\x69\156\163\x74\145\141\144\x2e"); } return $editor["\x61\x6a\x61\x78"]; } protected function getEditor($filePath, $line) { if (!$this->editor || !is_string($this->editor) && !is_callable($this->editor)) { return array(); } if (is_string($this->editor) && isset($this->editors[$this->editor]) && !is_callable($this->editors[$this->editor])) { return array("\x61\x6a\x61\170" => false, "\x75\x72\x6c" => $this->editors[$this->editor]); } if (is_callable($this->editor) || isset($this->editors[$this->editor]) && is_callable($this->editors[$this->editor])) { if (is_callable($this->editor)) { $callback = call_user_func($this->editor, $filePath, $line); } else { $callback = call_user_func($this->editors[$this->editor], $filePath, $line); } if (empty($callback)) { return array(); } if (is_string($callback)) { return array("\141\x6a\x61\x78" => false, "\165\x72\x6c" => $callback); } return array("\141\152\141\x78" => isset($callback["\141\x6a\x61\170"]) ? $callback["\141\152\141\x78"] : false, "\165\162\x6c" => isset($callback["\165\162\x6c"]) ? $callback["\165\x72\154"] : $callback); } return array(); } public function setPageTitle($title) { $this->pageTitle = (string) $title; return $this; } public function getPageTitle() { return $this->pageTitle; } public function addResourcePath($path) { if (!is_dir($path)) { throw new InvalidArgumentException("\x27{$path}\x27\40\x69\163\40\156\x6f\164\x20\141\40\x76\x61\x6c\x69\x64\40\144\x69\162\145\143\x74\157\162\x79"); } array_unshift($this->searchPaths, $path); return $this; } public function addCustomCss($name) { $this->customCss = $name; return $this; } public function addCustomJs($name) { $this->customJs = $name; return $this; } public function getResourcePaths() { return $this->searchPaths; } protected function getResource($resource) { if (isset($this->resourceCache[$resource])) { return $this->resourceCache[$resource]; } foreach ($this->searchPaths as $path) { $fullPath = $path . "\x2f{$resource}"; if (is_file($fullPath)) { $this->resourceCache[$resource] = $fullPath; return $fullPath; } } throw new RuntimeException("\103\x6f\165\154\144\x20\x6e\157\164\x20\146\x69\x6e\x64\40\162\145\163\157\x75\162\x63\x65\40\x27{$resource}\47\x20\151\156\x20\x61\156\x79\40\162\x65\163\157\x75\162\143\145\40\x70\x61\164\x68\163\56" . "\x28\163\145\x61\x72\143\x68\x65\x64\72\40" . join("\x2c\40", $this->searchPaths) . "\51"); } public function getResourcesPath() { $allPaths = $this->getResourcePaths(); return end($allPaths) ?: null; } public function setResourcesPath($resourcesPath) { $this->addResourcePath($resourcesPath); return $this; } public function getApplicationPaths() { return $this->applicationPaths; } public function setApplicationPaths(array $applicationPaths) { $this->applicationPaths = $applicationPaths; } public function setApplicationRootPath($applicationRootPath) { $this->templateHelper->setApplicationRootPath($applicationRootPath); } public function blacklist($superGlobalName, $key) { $this->blacklist[$superGlobalName][] = $key; return $this; } public function hideSuperglobalKey($superGlobalName, $key) { return $this->blacklist($superGlobalName, $key); } private function masked($superGlobal, $superGlobalName) { $blacklisted = $this->blacklist[$superGlobalName]; $values = $superGlobal; foreach ($blacklisted as $key) { if (isset($superGlobal[$key])) { $values[$key] = str_repeat("\52", is_string($superGlobal[$key]) ? strlen($superGlobal[$key]) : 3); } } return $values; } }

Function Calls

None

Variables

None

Stats

MD5 ad4476b11b0ba3365f1411fdf39aeab9
Eval Count 0
Decode Time 87 ms