You are here

function config_perms_unescape_perm_name in Custom Permissions 7.2

Recursively decode HTML in the permission name becasue we don't know how many times it has been encoded.

Parameters

string $name: The permission name.

array $derivitives: An array of derivative name for the permission name.

Return value

string The new permission name.

1 call to config_perms_unescape_perm_name()
config_perms_update_7201 in ./config_perms.install
Fix permissions that were incorrectly stored with escaped HTML characters.

File

./config_perms.install, line 206
Installation file

Code

function config_perms_unescape_perm_name($name, &$derivatives) {
  $derivatives[] = $name;
  $decoded_name = htmlspecialchars_decode($name, ENT_QUOTES);
  if ($name != $decoded_name) {
    return config_perms_unescape_perm_name($decoded_name, $derivatives);
  }
  else {
    return $name;
  }
}