Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
9c3afca3
Commit
9c3afca3
authored
May 16, 2017
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed some concerns
parent
3b55e2bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+19
-10
No files found.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
9c3afca3
...
...
@@ -163,9 +163,10 @@ class OCI8Statement implements \IteratorAggregate, Statement
* @param string $statement The SQL statement to parse
* @param string $tokenOffset The offset to start searching from
* @param int $fragmentOffset The offset to build the next fragment from
* @param array $fragments Resulting query fragments
* @param string|null $currentLiteralDelimiter Current literal delimiter
* @param array $paramMap Parameter map
* @param string[] $fragments Fragments of the original statement not containing placeholders
* @param string|null $currentLiteralDelimiter The delimiter of the current string literal
* or NULL if not currently in a literal
* @param array<int, string> $paramMap Mapping of the original parameter positions to their named replacements
* @return bool Whether the token was found
*/
private
static
function
findPlaceholderOrOpeningQuote
(
...
...
@@ -182,17 +183,20 @@ class OCI8Statement implements \IteratorAggregate, Statement
return
false
;
}
if
(
$token
==
'?'
)
{
if
(
$token
==
=
'?'
)
{
$position
=
count
(
$paramMap
)
+
1
;
$param
=
':param'
.
$position
;
$fragments
[]
=
substr
(
$statement
,
$fragmentOffset
,
$tokenOffset
-
$fragmentOffset
);
$fragments
[]
=
$param
;
$paramMap
[
$position
]
=
$param
;
$fragmentOffset
=
++
$tokenOffset
;
}
else
{
$tokenOffset
+=
1
;
$fragmentOffset
=
$tokenOffset
;
return
true
;
}
$currentLiteralDelimiter
=
$token
;
++
$tokenOffset
;
}
return
true
;
}
...
...
@@ -202,7 +206,8 @@ class OCI8Statement implements \IteratorAggregate, Statement
*
* @param string $statement The SQL statement to parse
* @param string $tokenOffset The offset to start searching from
* @param string|null $currentLiteralDelimiter Current literal delimiter
* @param string|null $currentLiteralDelimiter The delimiter of the current string literal
* or NULL if not currently in a literal
* @return bool Whether the token was found
*/
private
static
function
findClosingQuote
(
...
...
@@ -210,7 +215,11 @@ class OCI8Statement implements \IteratorAggregate, Statement
&
$tokenOffset
,
&
$currentLiteralDelimiter
)
{
$token
=
self
::
findToken
(
$statement
,
$tokenOffset
,
'/(?<!\\\\)'
.
$currentLiteralDelimiter
.
'/'
);
$token
=
self
::
findToken
(
$statement
,
$tokenOffset
,
'/(?<!\\\\)'
.
preg_quote
(
$currentLiteralDelimiter
,
'/'
)
.
'/'
);
if
(
!
$token
)
{
return
false
;
...
...
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