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 Kanboard\Controller; use Kanboard\Model\UserMetadataModel; /** * Class..

Decoded Output download

<?php

namespace Kanboard\Controller;

use Kanboard\Model\UserMetadataModel;

/**
 * Class CommentListController
 *
 * @package Kanboard\Controller
 * @author  Frederic Guillot
 */
class CommentListController extends BaseController
{
    public function show()
    {
        $task = $this->getTask();
        $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');

        $this->response->html($this->template->render('comment_list/show', array(
            'task'     => $task,
            'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection),
            'editable' => $this->helper->user->hasProjectAccess('CommentController', 'edit', $task['project_id']),
        )));
    }

    public function save()
    {
        $task = $this->getTask();
        $values = $this->request->getValues();
        $values['task_id'] = $task['id'];
        $values['user_id'] = $this->userSession->getId();

        list($valid, ) = $this->commentValidator->validateCreation($values);

        if ($valid && $this->commentModel->create($values) !== false) {
            $this->flash->success(t('Comment added successfully.'));
        }

        $this->show();
    }

    public function toggleSorting()
    {
        $this->helper->comment->toggleSorting();
        $this->show();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Kanboard\Controller;

use Kanboard\Model\UserMetadataModel;

/**
 * Class CommentListController
 *
 * @package Kanboard\Controller
 * @author  Frederic Guillot
 */
class CommentListController extends BaseController
{
    public function show()
    {
        $task = $this->getTask();
        $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');

        $this->response->html($this->template->render('comment_list/show', array(
            'task'     => $task,
            'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection),
            'editable' => $this->helper->user->hasProjectAccess('CommentController', 'edit', $task['project_id']),
        )));
    }

    public function save()
    {
        $task = $this->getTask();
        $values = $this->request->getValues();
        $values['task_id'] = $task['id'];
        $values['user_id'] = $this->userSession->getId();

        list($valid, ) = $this->commentValidator->validateCreation($values);

        if ($valid && $this->commentModel->create($values) !== false) {
            $this->flash->success(t('Comment added successfully.'));
        }

        $this->show();
    }

    public function toggleSorting()
    {
        $this->helper->comment->toggleSorting();
        $this->show();
    }
}

Function Calls

None

Variables

None

Stats

MD5 98f22d10b81800a8ef37d45b700137ec
Eval Count 0
Decode Time 100 ms