Skip to content

Laravel Blade passing variable with string through @include causes error #8502

@joeyfb

Description

@joeyfb

In blade, when including a template and passing a variable with a string containg a "(" or ")" an error is generated. Below are steps to reproduce.

In Laravel 5.0.27 I am including a view with with a variable using the following code:

@include('layouts.article', [ 'mainTitle' => "404, page not found", 'mainContent' => "sorry, but the requested page does not exist :(" ]) 

which generates the following error...

FatalErrorException syntax ... error, unexpected ','

I've narrowed down the error to just the "(" in the "mainContent" variable string. When I remove the "(" the error disappears and everything runs as expected. I tested this on a fresh install of laravel (5.0.16) and it still had the issue.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions