aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/upgrades/2010052601.php
blob: a9cca6dc5618167f9f355876f184d82a11a9cea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

// Upgrade to fix encoding issues on group data: #1963

elgg_set_ignore_access(TRUE);

$params = array('type' => 'group',
				'limit' => 0);
$groups = elgg_get_entities($params);
if ($groups) {
	foreach ($groups as $group) {
		$group->name = _elgg_html_decode($group->name);
		$group->description = _elgg_html_decode($group->description);
		$group->briefdescription = _elgg_html_decode($group->briefdescription);
		$group->website = _elgg_html_decode($group->website);
		if ($group->interests) {
			$tags = $group->interests;
			foreach ($tags as $index => $tag) {
				$tags[$index] = _elgg_html_decode($tag);
			}
			$group->interests = $tags;
		}

		$group->save();
	}
}
elgg_set_ignore_access(FALSE);