65a66 > $wgLDAPGroupsFixWhitespace = array(); 461a463,465 > case 'GroupsFixWhitespace': > global $wgLDAPGroupsFixWhitespace; > return self::setOrDefault($wgLDAPGroupsFixWhitespace, $domain, false ); 1641a1646,1661 > > // If we sync an LDAP group whose name contains whitespace, MediaWiki will fail to use > // the group correctly (Phabricator bug T87376). Transform the name to eliminate > // whitespace. > if ( $this->getConf( 'GroupsFixWhitespace' ) ) { > if (isset($this->userLDAPGroups) && isset($this->userLDAPGroups["short"])) { > foreach ($this->userLDAPGroups["short"] as $key => $value) { > $this->userLDAPGroups["short"][$key] = self::transformLDAPGroupName($value); > } > } > if (isset($this->allLDAPGroups) && isset($this->allLDAPGroups["short"])) { > foreach ($this->allLDAPGroups["short"] as $key => $value) { > $this->allLDAPGroups["short"][$key] = self::transformLDAPGroupName($value); > } > } > } 1644a1665,1677 > > /** > * Transform an LDAP group name to make it valid for MediaWiki. > * Make the function public and static so other extensions can perform the same > * transformation abstractly without knowing its details. > * > * @param $name > * @return string > */ > public static function transformLDAPGroupName($name) { > return str_replace(' ', '_', $name); > } >