Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix PMs permission checking #2999

Merged
merged 1 commit into from

2 participants

@socram8888

Signed-off-by: Marcos Vives Del Sol socram8888@gmail.com

list(), as the PHP manual itself says, can be only used on numeric arrays. Therefore it was failing when used on an array which has "allowed" and "denied" indices instead.

@socram8888 socram8888 Fix PMs permission checking
Signed-off-by: Marcos Vives Del Sol <socram8888@gmail.com>
05b4b36
@live627
Collaborator

Nice catch!

@live627 live627 merged commit f0bb3b7 into SimpleMachines:release-2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 22, 2015
  1. @socram8888

    Fix PMs permission checking

    socram8888 authored
    Signed-off-by: Marcos Vives Del Sol <socram8888@gmail.com>
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 Sources/Subs-Post.php
View
6 Sources/Subs-Post.php
@@ -922,10 +922,10 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
// Load the groups that are allowed to read PMs.
require_once($sourcedir . '/Subs-Members.php');
- list($allowed_groups, $disallowed_groups) = groupsAllowedTo('pm_read');
+ $pmReadGroups = groupsAllowedTo('pm_read');
if (empty($modSettings['permission_enable_deny']))
- $disallowed_groups = array();
+ $pmReadGroups['denied'] = array();
// Load their alert preferences
require_once($sourcedir . '/Subs-Notify.php');
@@ -991,7 +991,7 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
}
// Do they have any of the allowed groups?
- if (count(array_intersect($allowed_groups, $groups)) == 0 || count(array_intersect($disallowed_groups, $groups)) != 0)
+ if (count(array_intersect($pmReadGroups['allowed'], $groups)) == 0 || count(array_intersect($pmReadGroups['denied'], $groups)) != 0)
{
$log['failed'][$row['id_member']] = sprintf($txt['pm_error_user_cannot_read'], $row['real_name']);
unset($all_to[array_search($row['id_member'], $all_to)]);
Something went wrong with that request. Please try again.