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 /** * This file is part of the Phalcon Framework. * * (c) Phalcon Team <team@pha..

Decoded Output download

<?php

/**
 * This file is part of the Phalcon Framework.
 *
 * (c) Phalcon Team <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE.txt
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Phalcon\Tests\Integration\Mvc\View\Engine\Volt\Compiler;

use Codeception\Example;
use IntegrationTester;
use Phalcon\Mvc\View\Engine\Volt\Compiler;

/**
 * Class SetOptionCest
 */
class SetOptionCest
{
    /**
     * Tests Phalcon\Mvc\View\Engine\Volt\Compiler :: setOption() - autoescape
     *
     * @author       Phalcon Team <[email protected]>
     * @since        2017-01-17
     *
     * @dataProvider getVoltSetOptionAutoescape
     */
    public function mvcViewEngineVoltCompilerSetOptionAutoescape(IntegrationTester $I, Example $example)
    {
        $I->wantToTest("Mvc\View\Engine\Volt\Compiler - setOption() - autoescape");

        $param    = $example[0];
        $expected = $example[1];

        $volt = new Compiler();

        $volt->setOption('autoescape', true);

        $actual = $volt->compileString($param);
        $I->assertSame($expected, $actual);
    }

    /**
     * @return \string[][]
     */
    private function getVoltSetOptionAutoescape(): array
    {
        return [
            [
                '{{ "hello" }}{% autoescape true %}{{ "hello" }}' .
                '{% autoescape false %}{{ "hello" }}{% endautoescape %}' .
                '{{ "hello" }}{% endautoescape %}{{ "hello" }}',
                "<?= \$this->escaper->html('hello') ?>" .
                "<?= \$this->escaper->html('hello') ?>" .
                "<?= 'hello' ?><?= \$this->escaper->html('hello') ?>" .
                "<?= \$this->escaper->html('hello') ?>",
            ],
        ];
    }
}

Did this file decode correctly?

Original Code

<?php

/**
 * This file is part of the Phalcon Framework.
 *
 * (c) Phalcon Team <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE.txt
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Phalcon\Tests\Integration\Mvc\View\Engine\Volt\Compiler;

use Codeception\Example;
use IntegrationTester;
use Phalcon\Mvc\View\Engine\Volt\Compiler;

/**
 * Class SetOptionCest
 */
class SetOptionCest
{
    /**
     * Tests Phalcon\Mvc\View\Engine\Volt\Compiler :: setOption() - autoescape
     *
     * @author       Phalcon Team <[email protected]>
     * @since        2017-01-17
     *
     * @dataProvider getVoltSetOptionAutoescape
     */
    public function mvcViewEngineVoltCompilerSetOptionAutoescape(IntegrationTester $I, Example $example)
    {
        $I->wantToTest("Mvc\View\Engine\Volt\Compiler - setOption() - autoescape");

        $param    = $example[0];
        $expected = $example[1];

        $volt = new Compiler();

        $volt->setOption('autoescape', true);

        $actual = $volt->compileString($param);
        $I->assertSame($expected, $actual);
    }

    /**
     * @return \string[][]
     */
    private function getVoltSetOptionAutoescape(): array
    {
        return [
            [
                '{{ "hello" }}{% autoescape true %}{{ "hello" }}' .
                '{% autoescape false %}{{ "hello" }}{% endautoescape %}' .
                '{{ "hello" }}{% endautoescape %}{{ "hello" }}',
                "<?= \$this->escaper->html('hello') ?>" .
                "<?= \$this->escaper->html('hello') ?>" .
                "<?= 'hello' ?><?= \$this->escaper->html('hello') ?>" .
                "<?= \$this->escaper->html('hello') ?>",
            ],
        ];
    }
}

Function Calls

None

Variables

None

Stats

MD5 33a87ee570cf087955973b30c0c60796
Eval Count 0
Decode Time 93 ms