From a6fe447a9ae465d59aaba0e57d9551fd58bbbfd5 Mon Sep 17 00:00:00 2001 From: Zachary Durber Date: Tue, 10 Feb 2015 13:47:22 +0800 Subject: [PATCH] MDL-43415 auth_db: support textarea and uppercase fields --- auth/db/auth.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/auth/db/auth.php b/auth/db/auth.php index fe3ebeccf0e..9121c6e2798 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -218,7 +218,7 @@ class auth_plugin_db extends auth_plugin_base { $fields_obj = $rs->FetchObj(); $fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER); foreach ($selectfields as $localname=>$externalname) { - $result[$localname] = core_text::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8'); + $result[$localname] = core_text::convert($fields_obj->{strtolower($localname)}, $this->config->extencoding, 'utf-8'); } } $rs->Close(); @@ -611,6 +611,10 @@ class auth_plugin_db extends auth_plugin_base { continue; } $nuvalue = $newuser->$key; + // Support for textarea fields. + if (isset($nuvalue['text'])) { + $nuvalue = $nuvalue['text']; + } if ($nuvalue != $value) { $update[] = $this->config->{"field_map_$key"}."='".$this->ext_addslashes(core_text::convert($nuvalue, 'utf-8', $this->config->extencoding))."'"; }