summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-13 14:33:41 -0700
committerEvan Prodromou <evan@status.net>2010-08-13 14:33:41 -0700
commit718317542940a8976f2c6f2a9ea09a04f2f00ca6 (patch)
tree2bae1e1b0ce628101453b83c7e4ddcce59b43c62 /lib
parent9f0715a9935966f3ec483bccc476d5baf3324b3c (diff)
parent029aa0c61c9942c0688fd3dc9aa2893311543db1 (diff)
Merge branch 'master' into 1.0.x
Diffstat (limited to 'lib')
-rw-r--r--lib/activitycontext.php6
-rw-r--r--lib/common.php4
-rw-r--r--lib/default.php3
-rw-r--r--lib/httpclient.php13
-rw-r--r--lib/language.php1
-rw-r--r--lib/mailbox.php1
-rw-r--r--lib/mysqlschema.php2
-rw-r--r--lib/noticelist.php3
-rw-r--r--lib/statusnet.php2
-rw-r--r--lib/stompqueuemanager.php2
-rw-r--r--lib/util.php5
11 files changed, 32 insertions, 10 deletions
diff --git a/lib/activitycontext.php b/lib/activitycontext.php
index 5afbb7fd2..09a457924 100644
--- a/lib/activitycontext.php
+++ b/lib/activitycontext.php
@@ -71,6 +71,7 @@ class ActivityContext
$links = $element->getElementsByTagNameNS(ActivityUtils::ATOM, ActivityUtils::LINK);
+ $attention = array();
for ($i = 0; $i < $links->length; $i++) {
$link = $links->item($i);
@@ -80,11 +81,12 @@ class ActivityContext
// XXX: Deprecate this in favour of "mentioned" from Salmon spec
// http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-salmon-00.html#SALR
if ($linkRel == self::ATTENTION) {
- $this->attention[] = $link->getAttribute(self::HREF);
+ $attention[] = $link->getAttribute(self::HREF);
} elseif ($linkRel == self::MENTIONED) {
- $this->attention[] = $link->getAttribute(self::HREF);
+ $attention[] = $link->getAttribute(self::HREF);
}
}
+ $this->attention = array_unique($attention);
}
/**
diff --git a/lib/common.php b/lib/common.php
index f04bd64b7..570666da7 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -22,10 +22,10 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
//exit with 200 response, if this is checking fancy from the installer
if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; }
-define('STATUSNET_VERSION', '0.9.3');
+define('STATUSNET_VERSION', '0.9.4beta2');
define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility
-define('STATUSNET_CODENAME', 'Half a World Away');
+define('STATUSNET_CODENAME', 'Orange Crush');
define('AVATAR_PROFILE_SIZE', 96);
define('AVATAR_STREAM_SIZE', 48);
diff --git a/lib/default.php b/lib/default.php
index e0081f316..76e4e44cf 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -321,6 +321,7 @@ $default =
'maxlength' => 25,
'maxnoticelength' => -1),
'http' => // HTTP client settings when contacting other sites
- array('ssl_cafile' => false // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt')
+ array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt')
+ 'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
),
);
diff --git a/lib/httpclient.php b/lib/httpclient.php
index b69f718e5..514a5afeb 100644
--- a/lib/httpclient.php
+++ b/lib/httpclient.php
@@ -145,6 +145,10 @@ class HTTPClient extends HTTP_Request2
$this->config['ssl_verify_peer'] = false;
}
+ if (common_config('http', 'curl') && extension_loaded('curl')) {
+ $this->config['adapter'] = 'HTTP_Request2_Adapter_Curl';
+ }
+
parent::__construct($url, $method, $config);
$this->setHeader('User-Agent', $this->userAgent());
}
@@ -204,6 +208,15 @@ class HTTPClient extends HTTP_Request2
protected function doRequest($url, $method, $headers)
{
$this->setUrl($url);
+
+ // Workaround for HTTP_Request2 not setting up SNI in socket contexts;
+ // This fixes cert validation for SSL virtual hosts using SNI.
+ // Requires PHP 5.3.2 or later and OpenSSL with SNI support.
+ if ($this->url->getScheme() == 'https' && defined('OPENSSL_TLSEXT_SERVER_NAME')) {
+ $this->config['ssl_SNI_enabled'] = true;
+ $this->config['ssl_SNI_server_name'] = $this->url->getHost();
+ }
+
$this->setMethod($method);
if ($headers) {
foreach ($headers as $header) {
diff --git a/lib/language.php b/lib/language.php
index d93e4e0ad..80d256807 100644
--- a/lib/language.php
+++ b/lib/language.php
@@ -310,6 +310,7 @@ function get_all_languages() {
'da' => array('q' => 0.8, 'lang' => 'da', 'name' => 'Danish', 'direction' => 'ltr'),
'de' => array('q' => 0.8, 'lang' => 'de', 'name' => 'German', 'direction' => 'ltr'),
'el' => array('q' => 0.1, 'lang' => 'el', 'name' => 'Greek', 'direction' => 'ltr'),
+ 'eo' => array('q' => 0.8, 'lang' => 'eo', 'name' => 'Esperanto', 'direction' => 'ltr'),
'en-us' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)', 'direction' => 'ltr'),
'en-gb' => array('q' => 1, 'lang' => 'en_GB', 'name' => 'English (British)', 'direction' => 'ltr'),
'en' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)', 'direction' => 'ltr'),
diff --git a/lib/mailbox.php b/lib/mailbox.php
index 90a58b4c4..2b00f5ffd 100644
--- a/lib/mailbox.php
+++ b/lib/mailbox.php
@@ -224,6 +224,7 @@ class MailboxAction extends CurrentUserDesignAction
if ($message->source) {
$this->elementStart('span', 'source');
+ // FIXME: bad i18n. Device should be a parameter (from %s).
$this->text(_('from'));
$this->element('span', 'device', $this->showSource($message->source));
$this->elementEnd('span');
diff --git a/lib/mysqlschema.php b/lib/mysqlschema.php
index 464c718f9..f9552c1dc 100644
--- a/lib/mysqlschema.php
+++ b/lib/mysqlschema.php
@@ -333,7 +333,7 @@ class MysqlSchema extends Schema
}
if (empty($name)) {
- $name = "$table_".implode("_", $columnNames)."_idx";
+ $name = "{$table}_".implode("_", $columnNames)."_idx";
}
$res = $this->conn->query("ALTER TABLE $table ".
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 17adf3a49..529d6a3f9 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -499,9 +499,10 @@ class NoticeListItem extends Widget
$ns = $this->notice->getSource();
if ($ns) {
- $source_name = _($ns->code);
+ $source_name = (empty($ns->name)) ? ($ns->code ? _($ns->code) : _('web')) : _($ns->name);
$this->out->text(' ');
$this->out->elementStart('span', 'source');
+ // FIXME: probably i18n issue. If "from" is followed by text, that should be a parameter to "from" (from %s).
$this->out->text(_('from'));
$this->out->text(' ');
diff --git a/lib/statusnet.php b/lib/statusnet.php
index ac5d10134..ff0502915 100644
--- a/lib/statusnet.php
+++ b/lib/statusnet.php
@@ -141,7 +141,7 @@ class StatusNet
return true;
}
- $sn = Status_network::staticGet($nickname);
+ $sn = Status_network::staticGet('nickname', $nickname);
if (empty($sn)) {
return false;
throw new Exception("No such site nickname '$nickname'");
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php
index 91faa8c36..fc98c77d4 100644
--- a/lib/stompqueuemanager.php
+++ b/lib/stompqueuemanager.php
@@ -649,7 +649,7 @@ class StompQueueManager extends QueueManager
*/
protected function updateSiteConfig($nickname)
{
- $sn = Status_network::staticGet($nickname);
+ $sn = Status_network::staticGet('nickname', $nickname);
if ($sn) {
$this->switchSite($nickname);
if (!in_array($nickname, $this->sites)) {
diff --git a/lib/util.php b/lib/util.php
index 8eff4e568..f187926b5 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -845,7 +845,10 @@ function common_linkify($url) {
} elseif (is_string($longurl_data)) {
$longurl = $longurl_data;
} else {
- throw new ServerException("Can't linkify url '$url'");
+ // Unable to reach the server to verify contents, etc
+ // Just pass the link on through for now.
+ common_log(LOG_ERR, "Can't linkify url '$url'");
+ $longurl = $url;
}
}
$attrs = array('href' => $canon, 'title' => $longurl, 'rel' => 'external');