From 6938e6cbe85916101971dc260313679f4bfc8373 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Mon, 31 Oct 2005 13:57:17 +0000
Subject: [PATCH] - Patch #35320 by asimmonds: couldn't save roles in
 admin/filters/...

---
 modules/filter.module        | 2 +-
 modules/filter/filter.module | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/filter.module b/modules/filter.module
index c09864a835d3..9251d79c0dd5 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -475,7 +475,7 @@ function filter_admin_filters_save($format, $toggles) {
   // We store the roles as a string for ease of use.
   // we should always set all roles to true when saving a default role.
   // We use leading and trailing comma's to allow easy substring matching.
-  $roles = isset($edit['roles']) ? $edit['roles'] : array();
+  $roles = isset($edit['roles']) ? array_keys($edit['roles']) : array();
   $roles = ','. implode(',', ($edit['default_format'] ? user_roles() : $roles)) .',';
 
   db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index c09864a835d3..9251d79c0dd5 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -475,7 +475,7 @@ function filter_admin_filters_save($format, $toggles) {
   // We store the roles as a string for ease of use.
   // we should always set all roles to true when saving a default role.
   // We use leading and trailing comma's to allow easy substring matching.
-  $roles = isset($edit['roles']) ? $edit['roles'] : array();
+  $roles = isset($edit['roles']) ? array_keys($edit['roles']) : array();
   $roles = ','. implode(',', ($edit['default_format'] ? user_roles() : $roles)) .',';
 
   db_query("UPDATE {filter_formats} SET cache = %d, name='%s', roles = '%s' WHERE format = %d", $cache, $name, $roles, $format);
-- 
GitLab