You are here

function _saferpermissions_is_banned_word in Safer Permissions 7

Checks if a permission contains a blacklisted word.

Parameters

string $name: Name of the permission.

array $info: Permission declaration.

Return value

bool

1 string reference to '_saferpermissions_is_banned_word'
saferpermissions_disallowed_permissions_anonymous in ./saferpermissions.module
Gathers the list of permission which should be banned for anonymous users.

File

./saferpermissions.module, line 305
Disallows unwanted permissions for anonymous.

Code

function _saferpermissions_is_banned_word($name, array $info) {
  foreach (saferpermissions_permission_wordlist() as $word) {
    if (preg_match('/\\b' . preg_quote($word, '/') . '\\b/im', $name)) {
      return TRUE;
    }
  }
  return FALSE;
}