aboutsummaryrefslogtreecommitdiff
path: root/mod/profile
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:51:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:51:32 +0000
commit08d3f7f2820ed971ce5171c9ce9e15dbf452cf3f (patch)
tree75fd0261d5f92442fae934a58a9404bc3ed162f1 /mod/profile
parent36ef345eb6425106f061fb866d9fa66d051e16df (diff)
downloadelgg-08d3f7f2820ed971ce5171c9ce9e15dbf452cf3f.tar.gz
elgg-08d3f7f2820ed971ce5171c9ce9e15dbf452cf3f.tar.bz2
Merged 5605:5622 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5623 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile')
-rw-r--r--mod/profile/actions/edit.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php
index 207559334..baeb49108 100644
--- a/mod/profile/actions/edit.php
+++ b/mod/profile/actions/edit.php
@@ -29,15 +29,21 @@ if (!is_array($accesslevel)) {
$accesslevel = array();
}
+/**
+ * wrapper for recursive array walk decoding
+ */
+function profile_array_decoder(&$v) {
+ $v = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
+}
+
+
foreach($CONFIG->profile as $shortname => $valuetype) {
// the decoding is a stop gag to prevent &amp;&amp; showing up in profile fields
// because it is escaped on both input (get_input()) and output (view:output/text). see #561 and #1405.
// must decode in utf8 or string corruption occurs. see #1567.
$value = get_input($shortname);
if (is_array($value)) {
- foreach ($value as $k => $v) {
- $value[$k] = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
- }
+ array_walk_recursive($value, 'profile_array_decoder');
} else {
$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');
}
@@ -104,4 +110,4 @@ if (sizeof($input) > 0) {
system_message(elgg_echo("profile:saved"));
}
-forward($profile_owner->getUrl()); \ No newline at end of file
+forward($profile_owner->getUrl());