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 declare(strict_types=1); namespace App\Controllers\Admin\Setting; use App\Control..

Decoded Output download

<?php

declare(strict_types=1);

namespace App\Controllers\Admin\Setting;

use App\Controllers\BaseController;
use App\Models\Config;
use Exception;
use Psr\Http\Message\ResponseInterface;
use Slim\Http\Response;
use Slim\Http\ServerRequest;

final class SupportController extends BaseController
{
    private static array $update_field = [
        'live_chat',
        'crisp_id',
        'livechat_license',
        // Ticket
        'enable_ticket',
        'mail_ticket',
        'ticket_limit',
    ];

    /**
     * @throws Exception
     */
    public function index(ServerRequest $request, Response $response, array $args): ResponseInterface
    {
        $settings = Config::getClass('support');

        return $response->write(
            $this->view()
                ->assign('update_field', self::$update_field)
                ->assign('settings', $settings)
                ->fetch('admin/setting/support.tpl')
        );
    }

    public function save(ServerRequest $request, Response $response, array $args): ResponseInterface
    {
        foreach (self::$update_field as $item) {
            if (! Config::set($item, $request->getParam($item))) {
                return $response->withJson([
                    'ret' => 0,
                    'msg' => ' ' . $item . ' ',
                ]);
            }
        }

        return $response->withJson([
            'ret' => 1,
            'msg' => '',
        ]);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace App\Controllers\Admin\Setting;

use App\Controllers\BaseController;
use App\Models\Config;
use Exception;
use Psr\Http\Message\ResponseInterface;
use Slim\Http\Response;
use Slim\Http\ServerRequest;

final class SupportController extends BaseController
{
    private static array $update_field = [
        'live_chat',
        'crisp_id',
        'livechat_license',
        // Ticket
        'enable_ticket',
        'mail_ticket',
        'ticket_limit',
    ];

    /**
     * @throws Exception
     */
    public function index(ServerRequest $request, Response $response, array $args): ResponseInterface
    {
        $settings = Config::getClass('support');

        return $response->write(
            $this->view()
                ->assign('update_field', self::$update_field)
                ->assign('settings', $settings)
                ->fetch('admin/setting/support.tpl')
        );
    }

    public function save(ServerRequest $request, Response $response, array $args): ResponseInterface
    {
        foreach (self::$update_field as $item) {
            if (! Config::set($item, $request->getParam($item))) {
                return $response->withJson([
                    'ret' => 0,
                    'msg' => ' ' . $item . ' ',
                ]);
            }
        }

        return $response->withJson([
            'ret' => 1,
            'msg' => '',
        ]);
    }
}

Function Calls

None

Variables

None

Stats

MD5 7ee6d71e2ced552588ef5bfdb4b27af9
Eval Count 0
Decode Time 120 ms