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\Rules; use Illuminate\Contracts\Validation\Rule; class ImageData im..

Decoded Output download

<?php

namespace App\Rules;

use Illuminate\Contracts\Validation\Rule;

class ImageData implements Rule
{
    public function passes($attribute, $value): bool
    {
        return attempt(static function () use ($value) {
            [$header,] = explode(';', $value);

            return (bool) preg_match('/data:image\/(jpe?g|png|webp|gif)/i', $header);
        }, false) ?? false;
    }

    public function message(): string
    {
        return 'Invalid DataURL string';
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Rules;

use Illuminate\Contracts\Validation\Rule;

class ImageData implements Rule
{
    public function passes($attribute, $value): bool
    {
        return attempt(static function () use ($value) {
            [$header,] = explode(';', $value);

            return (bool) preg_match('/data:image\/(jpe?g|png|webp|gif)/i', $header);
        }, false) ?? false;
    }

    public function message(): string
    {
        return 'Invalid DataURL string';
    }
}

Function Calls

None

Variables

None

Stats

MD5 ba6493e5e7910565572545e7a3ce560b
Eval Count 0
Decode Time 108 ms