Laravel - Blade comments , blade rendering causing page to crash

后端 未结 6 1912
清歌不尽
清歌不尽 2020-12-13 09:43

I\'m rendering a page that is primarily a form with view::make in Laravel and it is crashing, causing ERR_CONNECTION_RESET. After a long investigation and many

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 10:18

    I have a similar symptom and it seems to be related to the length of the comment alone. I tested it with a comment that doesn't contain any PHP code or blade statements at all:

    {{--
    0123456789abcdef
    0123456789abcdef
    0123456789abcdef
    --}}
    

    I kept adding copies of the repeated line until it crashed. The comment was lexically followed by a blade @if statement, and the corresponding did not end up in the compiled template, but the closing did, resulting in a syntactically invalid compiled template.

    It seems to be a bug in the blade compiler and I will report it.

    The workaround is to split long blade comments with --}}{{--.

提交回复
热议问题