1
0

Unify gravatar

This commit is contained in:
Garvin Hicking
2015-03-12 10:44:24 +01:00
parent b76e117366
commit f5669177de

View File

@@ -14,7 +14,7 @@ if (file_exists($probelang)) {
include dirname(__FILE__) . '/lang_en.inc.php'; include dirname(__FILE__) . '/lang_en.inc.php';
// Actual version of this plugin // Actual version of this plugin
@define('PLUGIN_EVENT_GRAVATAR_VERSION', '1.58'); @define('PLUGIN_EVENT_GRAVATAR_VERSION', '1.59'); // NOTE: This plugin is also in the central repository. Commit changes to the core, too :)
// Defines the maximum available method slots in the configuration. // Defines the maximum available method slots in the configuration.
@define('PLUGIN_EVENT_GRAVATAR_METHOD_MAX', 6); @define('PLUGIN_EVENT_GRAVATAR_METHOD_MAX', 6);
@@ -438,7 +438,7 @@ class serendipity_event_gravatar extends serendipity_event
$title = ''; $title = '';
$author = 'unknown'; $author = 'unknown';
if (isset($eventData['author'])) { if (isset($eventData['author'])) {
$author = serendipity_specialchars($eventData['author']); $author = (function_exists('serendipity_specialchars') ? serendipity_specialchars($eventData['author']) : htmlspecialchars($eventData['author'], ENT_COMPAT, LANG_CHARSET));
$title = $author; $title = $author;
} }
@@ -778,7 +778,7 @@ class serendipity_event_gravatar extends serendipity_event
{ {
// Attempt to grab an avatar link from their webpage url // Attempt to grab an avatar link from their webpage url
$linkUrl = serendipity_entity_decode($matches[1]); $linkUrl = (function_exists('serendipity_entity_decode') ? serendipity_entity_decode($matches[1]) : html_entity_decode($matches[1], ENT_COMPAT, LANG_CHARSET));
if (substr($linkUrl, 0, 1) == '/') { if (substr($linkUrl, 0, 1) == '/') {
if ($urlParts = parse_url($url)) { if ($urlParts = parse_url($url)) {
$faviconURL = $urlParts['scheme'] . '://' . $urlParts['host'] . $linkUrl; $faviconURL = $urlParts['scheme'] . '://' . $urlParts['host'] . $linkUrl;