Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
301
Merge Requests
301
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
68cd2e55
Unverified
Commit
68cd2e55
authored
Jun 09, 2018
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2932777
by mondrake, borisson_, alexpott, daffie: Risky count() in SQLite Statement
parent
0daa2b52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
+1
-1
core/lib/Drupal/Core/Database/StatementInterface.php
core/lib/Drupal/Core/Database/StatementInterface.php
+1
-1
core/lib/Drupal/Core/Database/StatementPrefetch.php
core/lib/Drupal/Core/Database/StatementPrefetch.php
+2
-2
No files found.
core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
View file @
68cd2e55
...
...
@@ -27,7 +27,7 @@ class Statement extends StatementPrefetch implements StatementInterface {
* See http://bugs.php.net/bug.php?id=45259 for more details.
*/
protected
function
getStatement
(
$query
,
&
$args
=
[])
{
if
(
count
(
$args
))
{
if
(
is_array
(
$args
)
&&
!
empty
(
$args
))
{
// Check if $args is a simple numeric array.
if
(
range
(
0
,
count
(
$args
)
-
1
)
===
array_keys
(
$args
))
{
// In that case, we have unnamed placeholders.
...
...
core/lib/Drupal/Core/Database/StatementInterface.php
View file @
68cd2e55
...
...
@@ -44,7 +44,7 @@ interface StatementInterface extends \Traversable {
*
* @param $args
* An array of values with as many elements as there are bound parameters in
* the SQL statement being executed.
* the SQL statement being executed.
This can be NULL.
* @param $options
* An array of options for this query.
*
...
...
core/lib/Drupal/Core/Database/StatementPrefetch.php
View file @
68cd2e55
...
...
@@ -214,8 +214,8 @@ protected function throwPDOException() {
*
* @param $query
* The query.
* @param array $args
* An array of arguments.
* @param array
|null
$args
* An array of arguments.
This can be NULL.
* @return \PDOStatement
* A PDOStatement object.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment