Skip to content

[10.x] Don't crash if replacement cannot be represented as a string - #48530

Merged
taylorotwell merged 2 commits into
laravel:10.xfrom
GrahamCampbell:repl-str-fail
Oct 6, 2023
Merged

taylorotwell merged 2 commits into
laravel:10.xfrom
GrahamCampbell:repl-str-fail

Conversation

@GrahamCampbell

Copy link
Copy Markdown
Collaborator

Fixes

Error Object of class stdClass could not be converted to string 
    vendor/laravel/framework/src/Illuminate/Support/Str.php:989 Illuminate\Support\Str::replaceArray
    vendor/laravel/framework/src/Illuminate/Database/QueryException.php:67 Illuminate\Database\QueryException::formatMessage
    vendor/laravel/framework/src/Illuminate/Database/QueryException.php:49 Illuminate\Database\QueryException::__construct
    vendor/laravel/framework/src/Illuminate/Database/Connection.php:801 Illuminate\Database\Connection::runQueryCallback
    vendor/laravel/framework/src/Illuminate/Database/Connection.php:755 Illuminate\Database\Connection::run
    vendor/laravel/framework/src/Illuminate/Database/Connection.php:407 Illuminate\Database\Connection::select
    vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:469 Illuminate\Database\DatabaseManager::__call
    vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:353 Illuminate\Support\Facades\Facade::__callStatic

@taylorotwell
taylorotwell marked this pull request as draft September 25, 2023 13:48
Comment thread src/Illuminate/Support/Str.php Outdated
@GrahamCampbell
GrahamCampbell force-pushed the repl-str-fail branch 3 times, most recently from 2bfc677 to de8e9ca Compare October 4, 2023 19:06
@GrahamCampbell
GrahamCampbell marked this pull request as ready for review October 4, 2023 19:19
@GrahamCampbell

Copy link
Copy Markdown
Collaborator Author

Finally got around to finishing this off. Sorry!

@taylorotwell
taylorotwell merged commit fcceb52 into laravel:10.x Oct 6, 2023
@GrahamCampbell
GrahamCampbell deleted the repl-str-fail branch October 6, 2023 13:42
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 24, 2023
…aravel#48530)

* Don't crash if replacement cannot be represented as a string

* Update Str.php

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants