Skip to content

Commit

Permalink
Use preg_match_all in Video::saveFile
Browse files Browse the repository at this point in the history
На самом деле там должен был быть и так preg_match_all но видимо какао((
  • Loading branch information
celestora committed Jan 27, 2023
1 parent 8dffa8a commit 63f302b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Web/Models/Entities/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function saveFile(string $filename, string $hash): bool
throw new \DomainException("$filename does not contain any video streams");

$durations = [];
preg_match('%duration=([0-9\.]++)%', $streams, $durations);
preg_match_all('%duration=([0-9\.]++)%', $streams, $durations);
if(sizeof($durations[1]) === 0)
throw new \DomainException("$filename does not contain any meaningful video streams");

Expand Down

0 comments on commit 63f302b

Please sign in to comment.