summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/GeonamesPlugin.php13
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php6
2 files changed, 15 insertions, 4 deletions
diff --git a/plugins/GeonamesPlugin.php b/plugins/GeonamesPlugin.php
index 589462ed9..f018e2694 100644
--- a/plugins/GeonamesPlugin.php
+++ b/plugins/GeonamesPlugin.php
@@ -55,6 +55,8 @@ class GeonamesPlugin extends Plugin
public $username = null;
public $token = null;
public $expiry = 7776000; // 90-day expiry
+ public $cachePrefix = null; // Optional shared memcache prefix override
+ // to share lookups between local instances.
/**
* convert a name into a Location object
@@ -408,9 +410,14 @@ class GeonamesPlugin extends Plugin
function cacheKey($attrs)
{
- return common_cache_key('geonames:'.
- implode(',', array_keys($attrs)) . ':'.
- common_keyize(implode(',', array_values($attrs))));
+ $key = 'geonames:' .
+ implode(',', array_keys($attrs)) . ':'.
+ common_keyize(implode(',', array_values($attrs)));
+ if ($this->cachePrefix) {
+ return $this->cachePrefix . ':' . $key;
+ } else {
+ return common_cache_key($key);
+ }
}
function wsUrl($method, $params)
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 34bff548d..8ba2ce0c3 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -1685,7 +1685,11 @@ class Ostatus_profile extends Memcached_DataObject
*/
function saveHTMLFile($title, $rendered)
{
- $final = sprintf("<!DOCTYPE html>\n<html><head><title>%s</title></head>".
+ $final = sprintf("<!DOCTYPE html>\n" .
+ '<html><head>' .
+ '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' .
+ '<title>%s</title>' .
+ '</head>' .
'<body>%s</body></html>',
htmlspecialchars($title),
$rendered);