[GH-ISSUE #707] Problems in PHPStreamer - Byterange (Wrong assignations) #499

Closed
opened 2026-02-26 02:33:23 +03:00 by kerem · 0 comments
Owner

Originally created by @skeyby on GitHub (Jan 4, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/707

There is some broken code in app/Services/Streamers/PHPStreamer.php, specifically in the byte-range section.

Around line 47 there's a nonsense op:

            if ($range[0] === '') {
                // First number missing, return last $range[1] bytes
                $end = $fileSize - 1;
                $start = $end - (int) $range[0];

If range[0] is "" what's the purpose of casting it to integer?

Furthermore I don't think the actual logic of it is correct. If the first number in the range is missing (Range: -1000) I guess $start should be 0 and $end should be 1000... isn't?

Originally created by @skeyby on GitHub (Jan 4, 2018). Original GitHub issue: https://github.com/koel/koel/issues/707 There is some broken code in app/Services/Streamers/PHPStreamer.php, specifically in the byte-range section. Around line 47 there's a nonsense op: ``` if ($range[0] === '') { // First number missing, return last $range[1] bytes $end = $fileSize - 1; $start = $end - (int) $range[0]; ``` If range[0] is "" what's the purpose of casting it to integer? Furthermore I don't think the actual logic of it is correct. If the first number in the range is missing (Range: -1000) I guess $start should be 0 and $end should be 1000... isn't?
kerem closed this issue 2026-02-26 02:33:23 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#499
No description provided.