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 App\Controller; use Psr\Cache\CacheItemPoolInterface as CachePool; use S..
Decoded Output download
<?php
namespace App\Controller; use Psr\Cache\CacheItemPoolInterface as CachePool; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Contracts\Cache\ItemInterface; use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Psr7\Request as GuzzleRequest; use App\Entity\Manager\AnnouncementManager; use App\Entity\Manager\ConfigManager; use App\CloudPanel\Environment as CloudPanelEnvironment; class AppController extends Controller { const HTTP_CLIENT_TIMEOUT = 10; const APP_VERSION_CHECK_REQUEST_URL = "https://version.cloudpanel.io/v2"; public function displayAnnouncement(Request $request, AnnouncementManager $announcementManager) : Response { goto F620c; f936a: $response = $this->render("Partial/announcement.html.twig", ["announcement" => $announcement]); goto fec78; fec78: return $response; goto acc75; C0710: $announcement = $announcementManager->findLatestUnreadAnnouncement($user); goto f936a; F620c: $user = $this->getUser(); goto C0710; acc75: } public function setAnnouncementRead(Request $request, AnnouncementManager $announcementManager) : Response { goto f1799; f56e8: foreach ($userAnnouncements as $announcement) { goto a6692; Eb900: Ca901: goto eccae; f6f3a: $announcementManager->updateEntity($announcement); goto Eb900; a6692: $announcement->setIsRead(true); goto f6f3a; eccae: } goto b41ee; F4485: $announcementId = (int) $request->get("announcementId"); goto c15ff; b41ee: ef4fa: goto a4875; c15ff: if (!(true === $request->isMethod("POST") && false === empty($announcementId))) { goto C75be; } goto d4fec; De5f5: C75be: goto ff42e; Dc67c: ce7b8: goto De5f5; d4fec: $announcement = $announcementManager->findOneById($announcementId); goto D5b48; a4875: bce9b: goto Dc67c; ff42e: return $response; goto b7124; c4a6a: $userAnnouncements = $announcementManager->findAllUnreadAnnouncementsForUser($user); goto fc82a; f1799: $user = $this->getUser(); goto ad965; D5b48: if (!(false === is_null($announcement) && $announcement->getUser()->getId() == $user->getId())) { goto ce7b8; } goto c4a6a; ad965: $response = new Response(); goto F4485; fc82a: if (!(false === empty($userAnnouncements))) { goto bce9b; } goto f56e8; b7124: } public function checkAppVersion(Request $request, CachePool $cachePool, ConfigManager $configManager) : Response { goto fd659; c70b2: $data["updateAvailable"] = true; goto c51a6; aa8d6: $requestUrl = sprintf("%s%s", self::APP_VERSION_CHECK_REQUEST_URL, CloudPanelEnvironment::RELEASE_CHANNEL_TEST == $releaseChannel ? "-test" : ''); goto C21de; cae0e: $currentAppVersion = $this->getParameter("app_version"); goto eadf1; eadf1: if (!(false === empty($latestAppVersion) && false === empty($currentAppVersion))) { goto fe26d; } goto Fb7e7; C21de: $latestAppVersion = $cachePool->get("app_version", function (ItemInterface $item) use($requestUrl) { goto b6753; d68c4: try { goto Cb0a6; Cb0a6: $httpClient = new HttpClient($config); goto f35c2; a67ef: $appVersion = trim((string) $response->getBody()); goto fa190; e7875: $response = $httpClient->send($request); goto C0ff7; acb5c: if (!(200 == $responseStatusCode)) { goto fb92b; } goto a67ef; fa190: fb92b: goto Bb28c; C0ff7: $responseStatusCode = $response->getStatusCode(); goto acb5c; f35c2: $request = new GuzzleRequest("GET", $requestUrl); goto e7875; Bb28c: } catch (\Exception $e) { } goto f24b9; Bcca6: $appVersion = ''; goto fc4a4; f24b9: return $appVersion; goto Ba825; fc4a4: $config = ["timeout" => self::HTTP_CLIENT_TIMEOUT, "verify" => false, "headers" => ["User-Agent" => "CloudPanel v2"]]; goto d68c4; b6753: $item->expiresAfter(3600); goto Bcca6; Ba825: }); goto cae0e; c51a6: Dd942: goto E598e; C66ea: $releaseChannel = (string) $configManager->get("release_channel"); goto aa8d6; fd659: $data = []; goto C66ea; E598e: fe26d: goto a0efe; Fb7e7: if (!(version_compare($latestAppVersion, $currentAppVersion) > 0)) { goto Dd942; } goto c70b2; a0efe: return $this->json($data); goto f595a; f595a: } public function footerNavigation(RequestStack $requestStack) : Response { goto d14a8; d57ad: $response = $this->render("Partial/footer.html.twig", ["isAdminArea" => $isAdminArea]); goto fe0ec; f69b9: $isAdminArea = true === str_contains($requestUri, "admin"); goto d57ad; fe0ec: return $response; goto Dd11e; d14a8: $mainRequest = $requestStack->getMainRequest(); goto fdc6e; fdc6e: $requestUri = $mainRequest->getRequestUri(); goto f69b9; Dd11e: } public function changeLocale(Request $request) : Response { $response = $this->redirectToReferer($request); return $response; } } ?>
Did this file decode correctly?
Original Code
<?php
namespace App\Controller; use Psr\Cache\CacheItemPoolInterface as CachePool; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Contracts\Cache\ItemInterface; use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Psr7\Request as GuzzleRequest; use App\Entity\Manager\AnnouncementManager; use App\Entity\Manager\ConfigManager; use App\CloudPanel\Environment as CloudPanelEnvironment; class AppController extends Controller { const HTTP_CLIENT_TIMEOUT = 10; const APP_VERSION_CHECK_REQUEST_URL = "\150\164\164\x70\x73\x3a\x2f\x2f\x76\145\162\x73\x69\x6f\156\56\143\x6c\157\165\x64\x70\x61\x6e\x65\x6c\x2e\x69\157\57\x76\62"; public function displayAnnouncement(Request $request, AnnouncementManager $announcementManager) : Response { goto F620c; f936a: $response = $this->render("\120\141\x72\164\151\x61\x6c\x2f\x61\x6e\156\157\165\156\143\x65\x6d\145\x6e\x74\56\150\x74\155\x6c\56\x74\x77\x69\x67", ["\x61\x6e\x6e\157\x75\156\143\x65\155\x65\156\x74" => $announcement]); goto fec78; fec78: return $response; goto acc75; C0710: $announcement = $announcementManager->findLatestUnreadAnnouncement($user); goto f936a; F620c: $user = $this->getUser(); goto C0710; acc75: } public function setAnnouncementRead(Request $request, AnnouncementManager $announcementManager) : Response { goto f1799; f56e8: foreach ($userAnnouncements as $announcement) { goto a6692; Eb900: Ca901: goto eccae; f6f3a: $announcementManager->updateEntity($announcement); goto Eb900; a6692: $announcement->setIsRead(true); goto f6f3a; eccae: } goto b41ee; F4485: $announcementId = (int) $request->get("\x61\x6e\x6e\157\x75\x6e\143\145\155\x65\x6e\x74\x49\x64"); goto c15ff; b41ee: ef4fa: goto a4875; c15ff: if (!(true === $request->isMethod("\120\x4f\123\124") && false === empty($announcementId))) { goto C75be; } goto d4fec; De5f5: C75be: goto ff42e; Dc67c: ce7b8: goto De5f5; d4fec: $announcement = $announcementManager->findOneById($announcementId); goto D5b48; a4875: bce9b: goto Dc67c; ff42e: return $response; goto b7124; c4a6a: $userAnnouncements = $announcementManager->findAllUnreadAnnouncementsForUser($user); goto fc82a; f1799: $user = $this->getUser(); goto ad965; D5b48: if (!(false === is_null($announcement) && $announcement->getUser()->getId() == $user->getId())) { goto ce7b8; } goto c4a6a; ad965: $response = new Response(); goto F4485; fc82a: if (!(false === empty($userAnnouncements))) { goto bce9b; } goto f56e8; b7124: } public function checkAppVersion(Request $request, CachePool $cachePool, ConfigManager $configManager) : Response { goto fd659; c70b2: $data["\x75\160\144\x61\164\145\101\166\x61\151\154\141\x62\x6c\145"] = true; goto c51a6; aa8d6: $requestUrl = sprintf("\x25\x73\x25\x73", self::APP_VERSION_CHECK_REQUEST_URL, CloudPanelEnvironment::RELEASE_CHANNEL_TEST == $releaseChannel ? "\x2d\x74\145\x73\x74" : ''); goto C21de; cae0e: $currentAppVersion = $this->getParameter("\x61\x70\x70\137\166\145\x72\x73\x69\x6f\156"); goto eadf1; eadf1: if (!(false === empty($latestAppVersion) && false === empty($currentAppVersion))) { goto fe26d; } goto Fb7e7; C21de: $latestAppVersion = $cachePool->get("\141\160\x70\x5f\166\145\162\163\x69\157\156", function (ItemInterface $item) use($requestUrl) { goto b6753; d68c4: try { goto Cb0a6; Cb0a6: $httpClient = new HttpClient($config); goto f35c2; a67ef: $appVersion = trim((string) $response->getBody()); goto fa190; e7875: $response = $httpClient->send($request); goto C0ff7; acb5c: if (!(200 == $responseStatusCode)) { goto fb92b; } goto a67ef; fa190: fb92b: goto Bb28c; C0ff7: $responseStatusCode = $response->getStatusCode(); goto acb5c; f35c2: $request = new GuzzleRequest("\x47\x45\x54", $requestUrl); goto e7875; Bb28c: } catch (\Exception $e) { } goto f24b9; Bcca6: $appVersion = ''; goto fc4a4; f24b9: return $appVersion; goto Ba825; fc4a4: $config = ["\164\151\155\145\x6f\x75\x74" => self::HTTP_CLIENT_TIMEOUT, "\x76\x65\x72\x69\146\x79" => false, "\150\x65\x61\144\x65\162\x73" => ["\125\x73\145\x72\x2d\101\x67\x65\x6e\x74" => "\103\x6c\x6f\x75\144\x50\x61\156\145\x6c\40\x76\62"]]; goto d68c4; b6753: $item->expiresAfter(3600); goto Bcca6; Ba825: }); goto cae0e; c51a6: Dd942: goto E598e; C66ea: $releaseChannel = (string) $configManager->get("\x72\145\154\x65\x61\x73\145\137\x63\150\141\x6e\156\x65\x6c"); goto aa8d6; fd659: $data = []; goto C66ea; E598e: fe26d: goto a0efe; Fb7e7: if (!(version_compare($latestAppVersion, $currentAppVersion) > 0)) { goto Dd942; } goto c70b2; a0efe: return $this->json($data); goto f595a; f595a: } public function footerNavigation(RequestStack $requestStack) : Response { goto d14a8; d57ad: $response = $this->render("\120\141\162\x74\x69\141\154\57\x66\x6f\157\x74\145\x72\56\150\x74\x6d\x6c\x2e\x74\x77\151\x67", ["\151\x73\x41\x64\x6d\x69\x6e\x41\162\x65\x61" => $isAdminArea]); goto fe0ec; f69b9: $isAdminArea = true === str_contains($requestUri, "\141\144\155\x69\156"); goto d57ad; fe0ec: return $response; goto Dd11e; d14a8: $mainRequest = $requestStack->getMainRequest(); goto fdc6e; fdc6e: $requestUri = $mainRequest->getRequestUri(); goto f69b9; Dd11e: } public function changeLocale(Request $request) : Response { $response = $this->redirectToReferer($request); return $response; } }
Function Calls
None |
Stats
MD5 | 34419b67b87bfee20c68ea540da95798 |
Eval Count | 0 |
Decode Time | 66 ms |