Skip to content

Carbon setLocale error on Google Bot #41

@gepopp

Description

@gepopp

Hello,
i've a Laravel App in the current version 12.19.3 and your package in version 1.0.22 installed.

Everything works fine when the page is opened in a browser but if i try to index the page via the google search console or run a text with google page speed insights it thows an 500 error because in the nesbot/Carbon/Laravel/ServiceProvider on line 80 the app->getLocale retuns false.

This only happens when the "auto" setting is set to true because the Carbon::setLocale used in the previous mentioned ServiceProvider expects a string.

So the auto browser language detection should return null or a string, null instead of false if no language is detected.

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