-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: BaseConnection::_escapeString()
should accept Stringable
#8739
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
use CodeIgniter\Database\BaseConnection; | ||
use CodeIgniter\Database\Exceptions\DatabaseException; | ||
use stdClass; | ||
use Stringable; | ||
|
||
/** | ||
* Connection for SQLSRV | ||
|
@@ -182,7 +183,7 @@ protected function _close() | |
/** | ||
* Platform-dependant string escape | ||
*/ | ||
protected function _escapeString(string $str): string | ||
protected function _escapeString(string|Stringable $str): string | ||
{ | ||
return str_replace("'", "''", remove_invisible_characters($str, false)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,10 @@ Mandatory File Changes | |
Breaking Changes | ||
**************** | ||
|
||
- **QueryBuilder:** Due to a bug fix, the parameter type of ``BaseBuilder::_escapeString()`` | ||
has been changed from ``string`` to ``string|Stringable``. If you are extending | ||
this method, update the method paramtere type. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: paramtere - parameter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Done. |
||
|
||
********************* | ||
Breaking Enhancements | ||
********************* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question for
pg_escape_string
.I think we need to add a string cast to both function calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the good insight!