Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
d7d52fa5
Commit
d7d52fa5
authored
Dec 20, 2016
by
Florian Schaal
Browse files
prevent duplicate LIMIT in sql-class - Fixes #4384
parent
8b1e0d00
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/db_mysql.inc.php
View file @
d7d52fa5
...
...
@@ -314,7 +314,7 @@ class db extends mysqli
* @return array result row or NULL if none found
*/
public
function
queryOneRecord
(
$sQuery
=
''
)
{
if
(
!
preg_match
(
'/limit \d+\s*,\s*\d+$/i'
,
$sQuery
))
$sQuery
.
=
' LIMIT 0,1'
;
if
(
!
preg_match
(
'/limit \d+\s*
(
,\s*\d+
)?
$/i'
,
$sQuery
))
$sQuery
.
=
' LIMIT 0,1'
;
$aArgs
=
func_get_args
();
$oResult
=
call_user_func_array
(
array
(
&
$this
,
'query'
),
$aArgs
);
...
...
server/lib/classes/db_mysql.inc.php
View file @
d7d52fa5
...
...
@@ -278,7 +278,7 @@ class db extends mysqli
* @return array result row or NULL if none found
*/
public
function
queryOneRecord
(
$sQuery
=
''
)
{
if
(
!
preg_match
(
'/limit \d+\s*,\s*\d+$/i'
,
$sQuery
))
$sQuery
.
=
' LIMIT 0,1'
;
if
(
!
preg_match
(
'/limit \d+\s*
(
,\s*\d+
)?
$/i'
,
$sQuery
))
$sQuery
.
=
' LIMIT 0,1'
;
$aArgs
=
func_get_args
();
$oResult
=
call_user_func_array
(
array
(
&
$this
,
'query'
),
$aArgs
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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