Skip to content

Commit

Permalink
Decode numeric HTML entities in titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
eheikes committed Aug 14, 2017
1 parent 4ee60a0 commit 0f43672
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion toreadapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,15 @@ function getEntry() {
$tags[] = $tagInfo['name'];
}

$decodedTitle = html_entity_decode($item['title']);
$decodedTitle = preg_replace_callback("/&#[0-9]+;/", function($m) {
return mb_convert_encoding($m[0], 'UTF-8', 'HTML-ENTITIES');
}, $decodedTitle);

// Add the link info to the array.
$links[] = array(
'id' => intval($item['id']),
'title' => html_entity_decode($item['title']),
'title' => $decodedTitle,
'link' => $item['link'],
'description' => $item['keywords'],
'hasSnapshot' => !is_null($item['snapshot']),
Expand Down

0 comments on commit 0f43672

Please sign in to comment.