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\Http\Middleware; use Closure; use Illuminate\Http\Request; use Illum..

Decoded Output download

<?php 
 namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Symfony\Component\HttpFoundation\Response; class Access { public function handle(Request $request, Closure $next, $role) : Response { if ($request->host() != "localhost" && $request->host() != config("settings.demo")) { if (session("license") == '') { $data = array("domain" => $request->host()); $data_string = json_encode($data); $ch = curl_init("https://codeoga.com/license/check_license"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); $result = curl_exec($ch); $result = json_decode($result); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (@$result->status != "success") { Auth::guard("web")->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); $domain = $request->host(); $domain = str_replace(".", "meg_dot", $domain); return redirect()->to("https://codeoga.com/license/license_key/{$domain}"); } $request->session()->put("license", "Y"); } } $exp = explode("|", $role); if (!in_array(Auth::user()->user_role_id, $exp)) { return redirect()->route("welcome"); } return $next($request); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Http\Middleware; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Symfony\Component\HttpFoundation\Response; class Access { public function handle(Request $request, Closure $next, $role) : Response { if ($request->host() != "\x6c\x6f\x63\x61\x6c\x68\x6f\x73\164" && $request->host() != config("\163\x65\164\x74\151\x6e\147\x73\56\144\145\x6d\157")) { if (session("\x6c\151\x63\145\156\x73\145") == '') { $data = array("\144\x6f\155\x61\x69\x6e" => $request->host()); $data_string = json_encode($data); $ch = curl_init("\x68\x74\x74\160\163\x3a\x2f\57\143\x6f\x64\145\x6f\x67\141\56\x63\157\155\57\154\x69\143\145\x6e\x73\x65\57\x63\x68\145\x63\x6b\x5f\154\x69\143\x65\x6e\163\145"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "\120\117\123\124"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array("\103\x6f\x6e\164\x65\x6e\x74\55\124\171\160\145\72\x20\141\x70\x70\x6c\151\143\x61\x74\x69\157\x6e\x2f\x6a\163\x6f\156")); $result = curl_exec($ch); $result = json_decode($result); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (@$result->status != "\x73\x75\143\143\x65\x73\163") { Auth::guard("\167\x65\x62")->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); $domain = $request->host(); $domain = str_replace("\56", "\x6d\x65\x67\137\x64\157\x74", $domain); return redirect()->to("\150\164\164\160\x73\x3a\x2f\57\143\x6f\x64\x65\157\147\x61\56\x63\x6f\x6d\x2f\x6c\151\143\145\x6e\x73\145\x2f\x6c\x69\143\x65\x6e\x73\145\137\x6b\145\171\x2f{$domain}"); } $request->session()->put("\x6c\x69\143\145\156\163\145", "\131"); } } $exp = explode("\174", $role); if (!in_array(Auth::user()->user_role_id, $exp)) { return redirect()->route("\167\x65\x6c\x63\x6f\x6d\145"); } return $next($request); } }

Function Calls

None

Variables

None

Stats

MD5 91f7ec863153b08428743d823b0012e4
Eval Count 0
Decode Time 54 ms