mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Updated composer deps, applied latest StyleCI changes
This commit is contained in:
@ -12,7 +12,6 @@ use League\CommonMark\Extension\TaskList\TaskListExtension;
|
||||
|
||||
class MarkdownToHtml
|
||||
{
|
||||
|
||||
protected string $markdown;
|
||||
|
||||
public function __construct(string $markdown)
|
||||
@ -33,5 +32,4 @@ class MarkdownToHtml
|
||||
|
||||
return $converter->convertToHtml($this->markdown);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -112,5 +112,4 @@ class PageEditorData
|
||||
{
|
||||
return setting('app-editor') === 'markdown' ? 'markdown' : 'wysiwyg';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ class AttachmentApiController extends ApiController
|
||||
// Simply return a JSON response of the attachment for link-based attachments
|
||||
if ($attachment->external) {
|
||||
$attachment->setAttribute('content', $attachment->path);
|
||||
|
||||
return response()->json($attachment);
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ abstract class Controller extends BaseController
|
||||
*/
|
||||
protected function streamedDownloadResponse($stream, string $fileName): StreamedResponse
|
||||
{
|
||||
return response()->stream(function() use ($stream) {
|
||||
return response()->stream(function () use ($stream) {
|
||||
// End & flush the output buffer otherwise we still seem to use memory.
|
||||
// Ignore in testing since output buffers are used to gather a response.
|
||||
if (!app()->runningUnitTests()) {
|
||||
@ -167,10 +167,10 @@ abstract class Controller extends BaseController
|
||||
$sniffContent = fread($stream, 1000);
|
||||
$mime = (new WebSafeMimeSniffer())->sniff($sniffContent);
|
||||
|
||||
return response()->stream(function() use ($sniffContent, $stream) {
|
||||
echo $sniffContent;
|
||||
fpassthru($stream);
|
||||
fclose($stream);
|
||||
return response()->stream(function () use ($sniffContent, $stream) {
|
||||
echo $sniffContent;
|
||||
fpassthru($stream);
|
||||
fclose($stream);
|
||||
}, 200, [
|
||||
'Content-Type' => $mime,
|
||||
'Content-Disposition' => 'inline; filename="' . str_replace('"', '', $fileName) . '"',
|
||||
|
@ -19,7 +19,7 @@ class SettingController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle requests to the settings index path
|
||||
* Handle requests to the settings index path.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
@ -76,12 +76,12 @@ class AttachmentService
|
||||
/**
|
||||
* Stream an attachment from storage.
|
||||
*
|
||||
* @return resource|null
|
||||
* @throws FileNotFoundException
|
||||
*
|
||||
* @return resource|null
|
||||
*/
|
||||
public function streamAttachmentFromStorage(Attachment $attachment)
|
||||
{
|
||||
|
||||
return $this->getStorageDisk()->readStream($this->adjustPathForStorageDisk($attachment->path));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user