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
449055af
Commit
449055af
authored
Apr 04, 2014
by
Davi Koscianski Vidal
Committed by
lucasvanlierop
Jun 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checking for strings when converting to booleans
parent
37772e1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+19
-7
No files found.
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
449055af
...
...
@@ -698,13 +698,23 @@ class PostgreSqlPlatform extends AbstractPlatform
if
(
is_array
(
$item
))
{
foreach
(
$item
as
$key
=>
$value
)
{
if
(
is_bool
(
$value
)
||
is_numeric
(
$
item
))
{
if
(
is_bool
(
$value
)
||
is_numeric
(
$
value
))
{
$item
[
$key
]
=
(
$value
)
?
'true'
:
'false'
;
}
elseif
(
is_string
(
$value
))
{
$value
=
trim
(
strtolower
(
$value
));
if
(
'false'
!==
$value
&&
'f'
!==
$value
)
{
$item
[
$key
]
=
'true'
;
}
}
}
}
else
{
if
(
is_bool
(
$item
)
||
is_numeric
(
$item
))
{
$item
=
(
$item
)
?
'true'
:
'false'
;
}
elseif
(
is_string
(
$item
))
{
$item
=
trim
(
strtolower
(
$item
));
if
(
'false'
!==
$item
&&
'f'
!==
$item
)
{
$item
=
'true'
;
}
}
}
...
...
@@ -725,10 +735,11 @@ class PostgreSqlPlatform extends AbstractPlatform
if
(
is_bool
(
$value
)
||
is_numeric
(
$value
))
{
$item
[
$key
]
=
$value
?
1
:
0
;
}
elseif
(
is_string
(
$value
))
{
if
(
trim
(
strtolower
(
$item
))
===
'false'
)
{
$item
[
$key
]
=
0
;
}
else
{
$value
=
trim
(
strtolower
(
$item
));
if
(
'false'
!==
$value
&&
'f'
!==
$value
)
{
$item
[
$key
]
=
1
;
}
else
{
$item
[
$key
]
=
0
;
}
}
}
...
...
@@ -736,10 +747,11 @@ class PostgreSqlPlatform extends AbstractPlatform
if
(
is_bool
(
$item
)
||
is_numeric
(
$item
))
{
$item
=
$item
?
1
:
0
;
}
elseif
(
is_string
(
$item
))
{
if
(
trim
(
strtolower
(
$item
))
===
'false'
)
{
$item
=
0
;
}
else
{
$item
=
trim
(
strtolower
(
$item
));
if
(
'false'
!==
$item
&&
'f'
!==
$item
)
{
$item
=
1
;
}
else
{
$item
=
0
;
}
}
}
...
...
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