Issue Bug Closed

#107626Properly resolve resource modes in Stream::isWritable()

Oliver Hader 10/08/25, 09:12 updated 12/02/25, 13:04

Description

<?php

use TYPO3\CMS\Core\Http\HtmlResponse;

require_once 'vendor/autoload.php';

$response = new HtmlResponse('');
$stream = $response->getBody();
if ($stream->isWritable()) {
    $stream->write('Hello World');
}
var_dump((string)$stream);

The example above would just output an empty string, since the stream is not considered to be writable (which is incorrect, the stream actually is writable and was created with new Stream('php://temp', 'wb+')).

Reviews 2