contrib modules security updates

This commit is contained in:
Bachir Soussi Chiadmi
2016-10-13 12:10:40 +02:00
parent ffd758abc9
commit 747127f643
732 changed files with 67976 additions and 23207 deletions

View File

@@ -1020,8 +1020,21 @@ function views_access() {
* permissions. If the $account argument is omitted, the current user
* is used.
*/
function views_check_perm($perm, $account = NULL) {
return user_access($perm, $account) || user_access('access all views', $account);
function views_check_perm($perms, $account = NULL) {
// Backward compatibility to ensure also a single permission string is
// properly processed.
$perms = is_array($perms) ? $perms : array($perms);
if (user_access('access all views', $account)) {
return TRUE;
}
// Perms are handled as OR, as soon one permission allows access TRUE is
// returned.
foreach ($perms as $perm) {
if (user_access($perm, $account)) {
return TRUE;
}
}
return FALSE;
}
/**
@@ -1298,7 +1311,7 @@ function views_fetch_plugin_data($type = NULL, $plugin = NULL, $reset = FALSE) {
* Either 'display', 'style' or 'row'
* @param $key
* For style plugins, this is an optional type to restrict to. May be 'normal',
* 'summary', 'feed' or others based on the neds of the display.
* 'summary', 'feed' or others based on the needs of the display.
* @param $base
* An array of possible base tables.
*
@@ -2413,7 +2426,7 @@ function views_process_check_options($element, &$form_state) {
* Trim the field down to the specified length.
*
* @param $alter
* - max_length: Maximum lenght of the string, the rest gets truncated.
* - max_length: Maximum length of the string, the rest gets truncated.
* - word_boundary: Trim only on a word boundary.
* - ellipsis: Show an ellipsis (...) at the end of the trimmed string.
* - html: Take sure that the html is correct.