Commit eb6d5e1b authored by Tristan Olive's avatar Tristan Olive Committed by GitHub

Merge pull request #1806 from drshawnkwang/drupal_fix-usermodlinks-utf8

Drupal: Added UTF-8 encoding for loadHTML.
parents c6fe7c81 4ceda504
......@@ -714,7 +714,7 @@ function _boinc_create_moderator_links(&$links, &$moderator_links) {
// Create an array of HTML elements from the $links string, keys
// are the class attribute for the <li> tags.
$dom = new DOMDocument;
$dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8'));
foreach($dom->getElementsByTagName('li') as $node) {
$key = $node->getAttribute("class");
$alllinks[$key] = $dom->saveHTML($node);
......@@ -754,7 +754,7 @@ function _boinc_create_moderator_links(&$links, &$moderator_links) {
function _boinc_firstlink(&$alink) {
if (!empty($alink)) {
$dom = new DomDocument;
$dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8'));
$myli = $dom->getElementsByTagName('li');
if ($myli->length>0) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment