From 990bbea07e28abb5074f99217b2ddde6b8e5aa22 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 29 Mar 2010 16:27:50 -0700 Subject: Include meta charset header in saved HTML file for long OStatus messages; without, DOMDocument::loadHTML assumed Latin-1 instead of UTF-8. --- plugins/OStatus/classes/Ostatus_profile.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') 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("\n%s". + $final = sprintf("\n" . + '' . + '' . + '%s' . + '' . '%s', htmlspecialchars($title), $rendered); -- cgit v1.2.3-54-g00ecf From bfb2ac4910a52dde9bd3c39855f0488f56eb79bc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 30 Mar 2010 12:19:25 -0700 Subject: Shared cache key option for Geonames plugin, lets multi-instance sites share their cached geoname lookups. Example: unset($config['plugins']['default']['Geonames']); addPlugin('Geonames', array('cachePrefix' => 'statusnet:shared')); --- plugins/GeonamesPlugin.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins') 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) -- cgit v1.2.3-54-g00ecf