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 Frontend\Controllers; use Symfony\Component\Routing\RouteCollection; use..

Decoded Output download

<?php 
 namespace Frontend\Controllers; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\HttpFoundation\Request; use Frontend\App; use Frontend\Execution; class PageController { public function home($language, RouteCollection $routes) { $app = new App(); $controller = $app->helper->controller(); $data = $app->model->singletons($controller, "home"); $data["app"] = $app; $data["alternate"] = $app->helper->alternate(); $data["controller"] = $controller; $data["ldjson"] = $app->schema->organization()->toScript(); echo $app->helper->renderView($controller, $data); } public function sitemap($language, RouteCollection $routes) { $app = new App(); $routes = $app->helper->routes(); $sitemap["home"] = $app->helper->baseUrl(); $sitemap["about"] = $app->helper->routeSitemap(array(), "/{$routes["about"]}"); $sitemap["products"] = $app->helper->routeSitemap(array(), "/{$routes["products"]}"); $sitemap["faq"] = $app->helper->routeSitemap(array(), "/{$routes["faq"]}"); $sitemap["quality"] = $app->helper->routeSitemap(array(), "/{$routes["quality"]}"); $sitemap["contact"] = $app->helper->routeSitemap(array(), "/{$routes["contact"]}"); $sitemap["products_subpages"] = $app->model->sitemap("products"); foreach ($sitemap["products_subpages"] as $item) { if (!empty($item->_pid)) { $item->parents = $app->model->parents("products", $item->_pid); $item->parentUrl = $app->helper->routeSitemap(array_flip($item->parents), "/{$routes["products"]}"); $item->sitemapUrl = $item->parentUrl . "/" . $item->url; } else { $item->parentUrl = $app->helper->routeSitemap(array(), "/{$routes["products"]}"); $item->sitemapUrl = $item->parentUrl . "/" . $item->url; } } $sitemap["gdpr"] = $app->helper->routeSitemap(array(), "/{$routes["gdpr"]}"); $sitemap["gdpr_subpages"] = $app->model->sitemap("gdpr"); foreach ($sitemap["gdpr_subpages"] as $item) { if (!empty($item->_pid)) { $item->parents = $app->model->parents("gdpr", $item->_pid); $item->parentUrl = $app->helper->routeSitemap(array_flip($item->parents), "/{$routes["gdpr"]}"); $item->sitemapUrl = $item->parentUrl . "/" . $item->url; } else { $item->parentUrl = $app->helper->routeSitemap(array(), "/{$routes["gdpr"]}"); $item->sitemapUrl = $item->parentUrl . "/" . $item->url; } } header("Content-type: text/xml"); include "views/sitemap.php"; } public function index($language, $singleton, $page, RouteCollection $routes) { $app = new App(); $controller = $app->helper->controller($singleton); $data = $app->model->singletons($controller, $page); $breadcrumb = array($singleton => $data["page"]->title); $data["app"] = $app; $data["alternate"] = $app->helper->alternate($controller); $data["segments"] = array_keys($breadcrumb); $data["controller"] = $controller; $data["breadcrumb"] = $app->helper->breadcrumb($breadcrumb); $data["ldjson"] = $app->schema->graph(array("articleGraph" => $data, "organizationGraph" => null))->toScript(); echo $app->helper->renderView($controller, $data); } public function page($language, $singleton, $segments, RouteCollection $routes) { $app = new App(); $controller = $app->helper->controller($singleton); $data = $app->model->singletons($controller, $controller); $data["singleton"] = $data["page"]; $breadcrumb = array($singleton => $data["singleton"]->title); if (!empty($segments)) { unset($data["page"]); unset($data["widgets"]); $slugs = explode("/", $segments); if (is_numeric(end($slugs))) { $page = array_pop($slugs); $slug = array_pop($slugs); } else { $page = 1; $slug = array_pop($slugs); } $data["page"] = $app->model->page($controller, $slug); if (!empty($data["page"]->widgets)) { $data["widgets"] = $app->model->widgets($data["page"]->widgets); if (!empty($data["widgets"])) { $data["widgets"] = $app->model->organizeWidgets($data["widgets"], $data["page"]->order); } } $data["page"] = $app->model->subpages($controller, $data["page"], $page); $data["page"]->collections = !empty($data["page"]->collections) ? $app->model->collections($data["page"]->collections, $controller, $data["page"]->_id) : false; if (!empty($slugs)) { $parents = $app->model->parents($controller, $data["page"]->_pid); foreach ($slugs as $segment) { $verifyRoute = array_key_exists($segment, $parents) ? true : show_404(); } if ($verifyRoute === true) { foreach ($parents as $key => $parent) { $breadcrumb[$key] = $parent; } } } $breadcrumb[$data["page"]->url] = $data["page"]->title; } else { show_404(); } $data["template"] = !empty($data["page"]->template) ? $app->model->getTemplate($data["page"]->template->_id) : null; $data["app"] = $app; $data["controller"] = $controller; $data["alternate"] = $app->helper->alternate($controller, $data["page"]->_id, !empty($parents) ? $parents : null); $data["segments"] = array_keys($breadcrumb); $data["breadcrumb"] = $app->helper->breadcrumb($breadcrumb); $pageGraph = array("articleGraph" => $data, "organizationGraph" => null); $data["ldjson"] = $app->schema->graph($pageGraph)->toScript(); echo $app->helper->renderView("page", $data); } public function dumpcache($language, RouteCollection $routes) { $app = new App(); $app->helper->cache->clear(); if (isset($_POST)) { if (empty($_POST["token"])) { die(json_encode(array("data" => "Unauthorized!", "success" => false))); } $app = new App(); if ($_POST["token"] === $app->config->cacheToken) { $app->helper->cache->clear(); die(json_encode(array("data" => "Website cache cleared!", "success" => true))); } else { die(json_encode(array("data" => "Invalid token!", "success" => false))); } } else { die(json_encode(array("data" => "Unauthorized!", "success" => false))); } } public function submitform($language, $formName, RouteCollection $routes) { if (isset($_POST)) { if (empty($formName)) { die(json_encode(array("data" => "Form Controller Missing!", "success" => false))); } $app = new App(); $send = $app->form->run($formName); } else { die(json_encode(array("data" => "Unauthorized!", "success" => false))); } } public function submitrating($language, RouteCollection $routes) { if (isset($_POST)) { $app = new App(); $rating["pageID"] = trim(htmlspecialchars($_POST["pageID"])); $rating["name"] = trim(htmlspecialchars($_POST["name"])); $rating["email"] = trim(htmlspecialchars($_POST["email"])); $rating["review"] = trim(htmlspecialchars($_POST["review"])); $rating["service"] = trim(htmlspecialchars($_POST["service"])); $rating["status"] = 0; $submitRating = $app->model->submitRating("ratings", array("data" => $rating)); die(json_encode(array("data" => json_encode($submitRating), "success" => $submitRating))); } else { die(json_encode(array("data" => "Unauthorized access!", "success" => false))); } } public function newsletter($language, RouteCollection $routes) { if (isset($_POST)) { $app = new App(); $newsletter["email"] = trim(htmlspecialchars($_POST["email"])); if (!empty($newsletter["email"])) { $submitNewsletter = $app->model->submitNewsletter("newsletter", array("data" => $newsletter)); die(json_encode(array("data" => json_encode($submitNewsletter), "success" => $submitNewsletter))); } else { die(json_encode(array("data" => "Please provide an email.", "success" => false))); } } else { die(json_encode(array("data" => "Unauthorized access!", "success" => false))); } } public function searchajax($language, RouteCollection $routes) { if (isset($_POST)) { $app = new App(); $searched = trim(htmlspecialchars($_POST["q"])); $collections = array("destinations"); foreach ($collections as $collection) { $results[$collection] = $app->model->search($collection, $searched); } foreach ($results as $collection => $result) { if (!empty($result->ids)) { foreach ($result->ids as $i => $pageID) { $record = $app->model->pageById($collection, $pageID); $parents = !empty($record->_pid) ? array_keys($app->model->parents($collection, $record->_pid)) : null; if (!empty($parents)) { array_unshift($parents, $app->helper->alias($collection)); $record->parents = $parents; } else { continue; } $dataset[$collection][$i] = $record; } } } if (!empty($dataset)) { $data["searchResults"] = $dataset["destinations"]; } else { $data["searchResults"] = null; } die(json_encode(array("data" => json_encode($data["searchResults"]), "success" => true))); } else { die(json_encode(array("data" => "Unauthorized access!", "success" => false))); } } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace Frontend\Controllers; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\HttpFoundation\Request; use Frontend\App; use Frontend\Execution; class PageController { public function home($language, RouteCollection $routes) { $app = new App(); $controller = $app->helper->controller(); $data = $app->model->singletons($controller, "\150\157\x6d\145"); $data["\141\160\160"] = $app; $data["\x61\x6c\x74\x65\162\156\141\x74\145"] = $app->helper->alternate(); $data["\x63\157\x6e\164\162\x6f\x6c\x6c\x65\x72"] = $controller; $data["\154\144\x6a\163\157\156"] = $app->schema->organization()->toScript(); echo $app->helper->renderView($controller, $data); } public function sitemap($language, RouteCollection $routes) { $app = new App(); $routes = $app->helper->routes(); $sitemap["\x68\x6f\x6d\145"] = $app->helper->baseUrl(); $sitemap["\x61\142\157\x75\164"] = $app->helper->routeSitemap(array(), "\x2f{$routes["\141\x62\x6f\x75\x74"]}"); $sitemap["\160\x72\157\x64\x75\143\164\x73"] = $app->helper->routeSitemap(array(), "\x2f{$routes["\160\x72\x6f\x64\165\143\x74\163"]}"); $sitemap["\x66\x61\161"] = $app->helper->routeSitemap(array(), "\x2f{$routes["\146\141\x71"]}"); $sitemap["\x71\x75\x61\154\x69\x74\x79"] = $app->helper->routeSitemap(array(), "\57{$routes["\161\x75\141\x6c\151\x74\171"]}"); $sitemap["\x63\157\156\164\x61\x63\164"] = $app->helper->routeSitemap(array(), "\57{$routes["\x63\x6f\x6e\x74\x61\143\164"]}"); $sitemap["\160\162\157\144\x75\143\x74\x73\137\163\165\142\160\141\147\145\163"] = $app->model->sitemap("\160\162\157\x64\165\x63\x74\163"); foreach ($sitemap["\160\x72\157\x64\x75\x63\164\163\137\x73\x75\x62\160\x61\x67\145\x73"] as $item) { if (!empty($item->_pid)) { $item->parents = $app->model->parents("\160\162\x6f\x64\165\x63\x74\x73", $item->_pid); $item->parentUrl = $app->helper->routeSitemap(array_flip($item->parents), "\57{$routes["\160\x72\157\x64\x75\143\x74\x73"]}"); $item->sitemapUrl = $item->parentUrl . "\x2f" . $item->url; } else { $item->parentUrl = $app->helper->routeSitemap(array(), "\x2f{$routes["\x70\162\157\144\x75\143\x74\163"]}"); $item->sitemapUrl = $item->parentUrl . "\57" . $item->url; } } $sitemap["\x67\144\x70\162"] = $app->helper->routeSitemap(array(), "\57{$routes["\x67\x64\160\x72"]}"); $sitemap["\x67\144\160\x72\x5f\163\x75\142\x70\141\x67\145\x73"] = $app->model->sitemap("\147\144\160\162"); foreach ($sitemap["\x67\x64\x70\x72\137\x73\165\142\x70\x61\x67\145\x73"] as $item) { if (!empty($item->_pid)) { $item->parents = $app->model->parents("\147\144\160\x72", $item->_pid); $item->parentUrl = $app->helper->routeSitemap(array_flip($item->parents), "\57{$routes["\147\144\160\162"]}"); $item->sitemapUrl = $item->parentUrl . "\57" . $item->url; } else { $item->parentUrl = $app->helper->routeSitemap(array(), "\x2f{$routes["\147\144\x70\162"]}"); $item->sitemapUrl = $item->parentUrl . "\x2f" . $item->url; } } header("\103\x6f\156\x74\x65\x6e\164\x2d\x74\x79\160\x65\x3a\40\x74\x65\x78\164\57\170\155\x6c"); include "\x76\151\x65\x77\163\x2f\x73\151\x74\145\x6d\141\160\x2e\160\150\160"; } public function index($language, $singleton, $page, RouteCollection $routes) { $app = new App(); $controller = $app->helper->controller($singleton); $data = $app->model->singletons($controller, $page); $breadcrumb = array($singleton => $data["\x70\x61\x67\145"]->title); $data["\141\x70\x70"] = $app; $data["\x61\154\x74\145\x72\156\141\x74\x65"] = $app->helper->alternate($controller); $data["\163\x65\x67\x6d\145\156\x74\163"] = array_keys($breadcrumb); $data["\143\x6f\156\164\162\157\154\154\x65\x72"] = $controller; $data["\142\x72\145\141\x64\143\x72\x75\155\x62"] = $app->helper->breadcrumb($breadcrumb); $data["\x6c\x64\x6a\163\x6f\156"] = $app->schema->graph(array("\141\162\164\151\143\154\x65\107\162\x61\x70\x68" => $data, "\157\x72\147\x61\156\151\172\x61\164\x69\x6f\x6e\107\162\x61\x70\x68" => null))->toScript(); echo $app->helper->renderView($controller, $data); } public function page($language, $singleton, $segments, RouteCollection $routes) { $app = new App(); $controller = $app->helper->controller($singleton); $data = $app->model->singletons($controller, $controller); $data["\163\x69\156\147\x6c\x65\164\x6f\x6e"] = $data["\x70\x61\147\145"]; $breadcrumb = array($singleton => $data["\163\x69\156\147\154\x65\x74\x6f\156"]->title); if (!empty($segments)) { unset($data["\x70\x61\x67\x65"]); unset($data["\167\151\144\x67\x65\x74\x73"]); $slugs = explode("\x2f", $segments); if (is_numeric(end($slugs))) { $page = array_pop($slugs); $slug = array_pop($slugs); } else { $page = 1; $slug = array_pop($slugs); } $data["\160\x61\147\145"] = $app->model->page($controller, $slug); if (!empty($data["\160\x61\x67\x65"]->widgets)) { $data["\x77\x69\144\x67\145\164\x73"] = $app->model->widgets($data["\160\x61\147\145"]->widgets); if (!empty($data["\167\151\144\x67\x65\164\163"])) { $data["\167\151\144\147\145\x74\163"] = $app->model->organizeWidgets($data["\167\x69\x64\147\145\164\163"], $data["\160\x61\x67\145"]->order); } } $data["\x70\141\x67\x65"] = $app->model->subpages($controller, $data["\160\x61\x67\145"], $page); $data["\160\x61\147\145"]->collections = !empty($data["\x70\141\147\145"]->collections) ? $app->model->collections($data["\160\141\x67\145"]->collections, $controller, $data["\160\x61\x67\145"]->_id) : false; if (!empty($slugs)) { $parents = $app->model->parents($controller, $data["\x70\141\147\x65"]->_pid); foreach ($slugs as $segment) { $verifyRoute = array_key_exists($segment, $parents) ? true : show_404(); } if ($verifyRoute === true) { foreach ($parents as $key => $parent) { $breadcrumb[$key] = $parent; } } } $breadcrumb[$data["\x70\x61\147\x65"]->url] = $data["\160\x61\147\145"]->title; } else { show_404(); } $data["\164\145\x6d\160\x6c\x61\x74\145"] = !empty($data["\160\141\x67\145"]->template) ? $app->model->getTemplate($data["\x70\x61\x67\145"]->template->_id) : null; $data["\141\160\x70"] = $app; $data["\143\x6f\156\164\162\x6f\x6c\x6c\145\162"] = $controller; $data["\x61\154\164\145\x72\156\141\164\x65"] = $app->helper->alternate($controller, $data["\160\x61\x67\145"]->_id, !empty($parents) ? $parents : null); $data["\x73\x65\147\155\x65\156\x74\163"] = array_keys($breadcrumb); $data["\x62\x72\x65\141\x64\143\x72\x75\155\142"] = $app->helper->breadcrumb($breadcrumb); $pageGraph = array("\141\x72\x74\x69\x63\154\145\x47\x72\141\x70\150" => $data, "\x6f\x72\147\141\156\151\172\141\x74\x69\x6f\x6e\107\x72\x61\x70\150" => null); $data["\154\x64\152\x73\x6f\156"] = $app->schema->graph($pageGraph)->toScript(); echo $app->helper->renderView("\x70\x61\147\145", $data); } public function dumpcache($language, RouteCollection $routes) { $app = new App(); $app->helper->cache->clear(); if (isset($_POST)) { if (empty($_POST["\x74\157\x6b\145\x6e"])) { die(json_encode(array("\144\141\x74\x61" => "\x55\x6e\x61\165\x74\150\x6f\x72\151\172\x65\x64\x21", "\163\165\x63\x63\x65\x73\163" => false))); } $app = new App(); if ($_POST["\164\157\x6b\x65\x6e"] === $app->config->cacheToken) { $app->helper->cache->clear(); die(json_encode(array("\x64\141\164\x61" => "\x57\x65\142\x73\x69\164\145\40\x63\x61\x63\150\145\40\143\x6c\x65\141\162\x65\x64\41", "\163\165\x63\x63\145\163\x73" => true))); } else { die(json_encode(array("\144\141\164\x61" => "\111\x6e\166\x61\x6c\151\144\40\164\157\x6b\x65\156\x21", "\x73\165\x63\143\145\163\x73" => false))); } } else { die(json_encode(array("\x64\x61\x74\x61" => "\125\x6e\x61\x75\164\150\157\162\151\172\145\144\x21", "\163\165\x63\143\x65\x73\163" => false))); } } public function submitform($language, $formName, RouteCollection $routes) { if (isset($_POST)) { if (empty($formName)) { die(json_encode(array("\x64\x61\164\x61" => "\x46\x6f\162\155\x20\103\x6f\x6e\164\162\157\x6c\x6c\x65\x72\x20\115\x69\x73\x73\x69\x6e\147\41", "\163\x75\143\x63\145\163\x73" => false))); } $app = new App(); $send = $app->form->run($formName); } else { die(json_encode(array("\144\141\164\x61" => "\x55\156\141\165\x74\150\x6f\162\151\172\145\x64\41", "\x73\x75\x63\x63\145\163\163" => false))); } } public function submitrating($language, RouteCollection $routes) { if (isset($_POST)) { $app = new App(); $rating["\x70\141\x67\145\x49\104"] = trim(htmlspecialchars($_POST["\160\141\x67\x65\x49\x44"])); $rating["\x6e\141\x6d\145"] = trim(htmlspecialchars($_POST["\156\x61\x6d\145"])); $rating["\145\x6d\141\x69\154"] = trim(htmlspecialchars($_POST["\x65\155\141\x69\154"])); $rating["\x72\145\x76\151\x65\167"] = trim(htmlspecialchars($_POST["\x72\145\166\x69\x65\167"])); $rating["\x73\x65\x72\x76\x69\x63\145"] = trim(htmlspecialchars($_POST["\x73\x65\162\x76\x69\143\x65"])); $rating["\163\164\141\x74\x75\x73"] = 0; $submitRating = $app->model->submitRating("\x72\141\x74\151\156\147\163", array("\x64\141\x74\x61" => $rating)); die(json_encode(array("\144\141\164\141" => json_encode($submitRating), "\163\165\143\x63\145\x73\163" => $submitRating))); } else { die(json_encode(array("\x64\x61\x74\x61" => "\x55\156\x61\x75\x74\x68\x6f\162\x69\x7a\145\144\40\x61\x63\x63\x65\163\x73\x21", "\163\165\143\x63\145\x73\x73" => false))); } } public function newsletter($language, RouteCollection $routes) { if (isset($_POST)) { $app = new App(); $newsletter["\x65\x6d\x61\151\154"] = trim(htmlspecialchars($_POST["\145\155\141\x69\154"])); if (!empty($newsletter["\x65\x6d\x61\x69\x6c"])) { $submitNewsletter = $app->model->submitNewsletter("\x6e\145\x77\x73\x6c\145\x74\164\145\162", array("\144\x61\x74\x61" => $newsletter)); die(json_encode(array("\144\141\164\x61" => json_encode($submitNewsletter), "\x73\x75\143\x63\x65\163\x73" => $submitNewsletter))); } else { die(json_encode(array("\x64\141\x74\x61" => "\x50\x6c\x65\141\163\145\x20\160\162\x6f\x76\x69\144\x65\x20\141\x6e\x20\x65\155\x61\151\154\x2e", "\163\x75\x63\x63\145\x73\163" => false))); } } else { die(json_encode(array("\144\141\164\x61" => "\125\x6e\x61\x75\x74\x68\157\162\x69\172\x65\x64\40\x61\143\143\x65\163\163\x21", "\x73\x75\143\143\145\163\x73" => false))); } } public function searchajax($language, RouteCollection $routes) { if (isset($_POST)) { $app = new App(); $searched = trim(htmlspecialchars($_POST["\x71"])); $collections = array("\144\x65\x73\164\151\x6e\141\x74\151\157\156\163"); foreach ($collections as $collection) { $results[$collection] = $app->model->search($collection, $searched); } foreach ($results as $collection => $result) { if (!empty($result->ids)) { foreach ($result->ids as $i => $pageID) { $record = $app->model->pageById($collection, $pageID); $parents = !empty($record->_pid) ? array_keys($app->model->parents($collection, $record->_pid)) : null; if (!empty($parents)) { array_unshift($parents, $app->helper->alias($collection)); $record->parents = $parents; } else { continue; } $dataset[$collection][$i] = $record; } } } if (!empty($dataset)) { $data["\x73\145\x61\162\x63\x68\x52\x65\x73\165\154\x74\x73"] = $dataset["\x64\145\163\164\x69\156\x61\164\x69\x6f\x6e\x73"]; } else { $data["\x73\x65\141\x72\x63\x68\122\x65\x73\x75\x6c\164\x73"] = null; } die(json_encode(array("\x64\x61\164\141" => json_encode($data["\x73\x65\x61\x72\x63\150\122\x65\x73\165\154\164\163"]), "\163\165\143\x63\145\x73\163" => true))); } else { die(json_encode(array("\144\141\x74\141" => "\125\x6e\x61\165\164\x68\x6f\x72\151\x7a\x65\x64\x20\x61\143\143\145\163\163\41", "\163\x75\143\143\x65\163\163" => false))); } } }

Function Calls

None

Variables

None

Stats

MD5 ef40de45ef163e83a9459e402baa613f
Eval Count 0
Decode Time 148 ms