Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Str.php #35854

Closed
wants to merge 1 commit into from
Closed

Update Str.php #35854

wants to merge 1 commit into from

Commits on Jan 12, 2021

  1. Update Str.php

    When $haystack is null or is not a string, mb_strpos throws a 500 PHP error. I'm not sure how I got the 500 error, but have three environments in the same server sharing the same database, all running the same app with different subdomains. Session is managed with the files drive, but cache uses the database driver. Two sites run as expected, and the other one wasn't able to handle the request. After checking the PHP error log:
    
    [proxy_fcgi:error] [pid 256670] [client 190.104.120.178:59913] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: mb_strpos(): Argument laravel#1 ($haystack) must be of type string, null given, called in /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Support/Str.php on line 177 and defined in /var/www/test2.readforall.com/vendor/symfony/polyfill-mbstring/bootstrap80.php:60\nStack trace:\n#0 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Support/Str.php(177): mb_strpos()\n#1 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php(34): Illuminate\\Support\\Str::contains()\n#2 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Request.php(371): Illuminate\\Http\\Request->isJson()\n#3 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Request.php(435): Illuminate\\Http\\Request->getInputSource()\n#4 /var/www/test2.readforall.com/vendor/laravel/framework/src/Illuminate/Http/Request.php(64): Illuminate\\Http\\Request::createFromBase()\n#...'
    
    And adding the propose change, I was able to run the application as expected.
    rodrigokestler authored Jan 12, 2021
    Configuration menu
    Copy the full SHA
    2eebec8 View commit details
    Browse the repository at this point in the history