Skip to content

Commit

Permalink
Improve error checking on query
Browse files Browse the repository at this point in the history
  • Loading branch information
mark0263 committed Nov 5, 2017
1 parent 6df74d1 commit 6b5d5bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,4 +1,5 @@
## v1.7.2 (Unreleased)
- Improved error checking when retrieving group list for user
- Added missing comment_indent configuration option
- If 'Allow User Photo' was set to false, comments display had a broken image
- Added siteconfig.php $_SYSTEM option to skip automatic upgrade check in Command & Control
Expand Down
12 changes: 8 additions & 4 deletions private/system/lib-security.php
Expand Up @@ -611,11 +611,15 @@ function SEC_getUserPermissions($grp_id='',$uid='')
$groups = SEC_getUserGroups ($uid);
}

$glist = join(',', $groups);
$result = DB_query("SELECT DISTINCT ft_name FROM {$_TABLES["access"]},{$_TABLES["features"]} "
. "WHERE ft_id = acc_ft_id AND acc_grp_id IN ($glist)");
if ( count($groups) > 0 ) {
$glist = join(',', $groups);
$result = DB_query("SELECT DISTINCT ft_name FROM {$_TABLES["access"]},{$_TABLES["features"]} "
. "WHERE ft_id = acc_ft_id AND acc_grp_id IN ($glist)");

$nrows = DB_numrows($result);
$nrows = DB_numrows($result);
} else {
$nrows = 0;
}
for ($j = 1; $j <= $nrows; $j++) {
$A = DB_fetchArray($result);
if ($_SEC_VERBOSE) {
Expand Down

0 comments on commit 6b5d5bf

Please sign in to comment.