Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-MySQLi-Database-Class
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
Kulya
PHP-MySQLi-Database-Class
Commits
6f810c66
Commit
6f810c66
authored
May 10, 2015
by
Alexander Butenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added whitelist to setQueryOption
parent
7429e5a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
MysqliDb.php
MysqliDb.php
+13
-4
No files found.
MysqliDb.php
View file @
6f810c66
...
...
@@ -278,10 +278,19 @@ class MysqliDb
* @return MysqliDb
*/
public
function
setQueryOption
(
$options
)
{
if
(
is_array
(
$options
))
$this
->
_queryOptions
=
array_merge
(
$this
->
_queryOptions
,
$options
);
else
$this
->
_queryOptions
[]
=
$options
;
$allowedOptions
=
Array
(
'ALL'
,
'DISTINCT'
,
'DISTINCTROW'
,
'HIGH_PRIORITY'
,
'STRAIGHT_JOIN'
,
'SQL_SMALL_RESULT'
,
'SQL_BIG_RESULT'
,
'SQL_BUFFER_RESULT'
,
'SQL_CACHE'
,
'SQL_NO_CACHE'
,
'SQL_CALC_FOUND_ROWS'
,
'LOW_PRIORITY'
,
'IGNORE'
,
'QUICK'
);
if
(
!
is_array
(
$options
))
$options
=
Array
(
$options
);
foreach
(
$options
as
$option
)
{
$option
=
strtoupper
(
$option
);
if
(
!
in_array
(
$option
,
$allowedOptions
))
die
(
'Wrong query option: '
.
$option
);
$this
->
_queryOptions
[]
=
$option
;
}
return
$this
;
}
...
...
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