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\Services\Streamers; use App\Models\Song; class Streamer { prote..

Decoded Output download

<?php

namespace App\Services\Streamers;

use App\Models\Song;

class Streamer
{
    protected ?Song $song = null;

    protected ?string $contentType = null;

    public function __construct()
    {
        // Turn off error reporting to make sure our stream isn't interfered.
        @error_reporting(0);
    }

    public function setSong(Song $song): void
    {
        $this->song = $song;

        abort_unless($this->song->s3_params || file_exists($this->song->path), 404);

        // Hard code the content type instead of relying on PHP's fileinfo()
        // or even Symfony's MIMETypeGuesser, since they appear to be wrong sometimes.
        if (!$this->song->s3_params) {
            $this->contentType = 'audio/' . pathinfo($this->song->path, PATHINFO_EXTENSION);
        }
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Services\Streamers;

use App\Models\Song;

class Streamer
{
    protected ?Song $song = null;

    protected ?string $contentType = null;

    public function __construct()
    {
        // Turn off error reporting to make sure our stream isn't interfered.
        @error_reporting(0);
    }

    public function setSong(Song $song): void
    {
        $this->song = $song;

        abort_unless($this->song->s3_params || file_exists($this->song->path), 404);

        // Hard code the content type instead of relying on PHP's fileinfo()
        // or even Symfony's MIMETypeGuesser, since they appear to be wrong sometimes.
        if (!$this->song->s3_params) {
            $this->contentType = 'audio/' . pathinfo($this->song->path, PATHINFO_EXTENSION);
        }
    }
}

Function Calls

None

Variables

None

Stats

MD5 6d18c20af6061ed4d4f36a0416830401
Eval Count 0
Decode Time 88 ms