Skip to content

Commit

Permalink
Response::guardAgainstOutput(): add filename and line number
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Bestle <lukas@getkirby.com>
  • Loading branch information
distantnative and lukasbestle committed Sep 18, 2022
1 parent c47a08d commit 3150414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ public static function guardAgainstOutput(Closure $callback, ...$args): mixed
{
$before = headers_sent();
$result = $callback($args);
$after = headers_sent();
$after = headers_sent($file, $line);

if ($before === false && $after === true) {
throw new LogicException('Disallowed output from file $file:$line, possible accidental whitespace?');
throw new LogicException("Disallowed output from file $file:$line, possible accidental whitespace?");
}

return $result;
Expand Down

0 comments on commit 3150414

Please sign in to comment.