summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-08-16 10:06:52 -0700
committerBrion Vibber <brion@pobox.com>2010-08-16 10:06:52 -0700
commitb77c029aa811e08027d6dc8ed7d46be397eb6fb3 (patch)
treefac7f311276c9b7a6695ed3fc4962d6ec715216d
parent029aa0c61c9942c0688fd3dc9aa2893311543db1 (diff)
parent7f9ab683b259fc93d507eb705c84af0cfd2fae5b (diff)
Merge branch 'testing'
Conflicts: plugins/OStatus/classes/Ostatus_profile.php
-rw-r--r--db/statusnet_pg.sql1
-rw-r--r--lib/installer.php2
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php7
-rw-r--r--plugins/OStatus/lib/discoveryhints.php5
-rw-r--r--plugins/OStatus/lib/feeddiscovery.php5
-rw-r--r--plugins/SubMirror/actions/basemirror.php8
6 files changed, 19 insertions, 9 deletions
diff --git a/db/statusnet_pg.sql b/db/statusnet_pg.sql
index 2db98550c..fe0758de8 100644
--- a/db/statusnet_pg.sql
+++ b/db/statusnet_pg.sql
@@ -136,7 +136,6 @@ create table notice (
is_local integer default 0 /* comment 'notice was generated by a user' */,
source varchar(32) /* comment 'source of comment, like "web", "im", or "clientname"' */,
conversation integer /*id of root notice in this conversation' */ references notice (id),
- location varchar(255) /* comment 'physical location' */,
lat decimal(10,7) /* comment 'latitude'*/ ,
lon decimal(10,7) /* comment 'longitude'*/ ,
location_id integer /* comment 'location id if possible'*/ ,
diff --git a/lib/installer.php b/lib/installer.php
index ff2bed140..2eff2d85a 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -319,7 +319,7 @@ abstract class Installer
$this->updateStatus(sprintf("Adding %s data to database...", $name));
$res = $this->runDbScript($scr.'.sql', $conn, 'pgsql');
if ($res === false) {
- $this->updateStatus(sprintf("Can't run %d script.", $name), true);
+ $this->updateStatus(sprintf("Can't run %s script.", $name), true);
return false;
}
}
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 1fae468f6..a95612a7f 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -501,8 +501,11 @@ class Ostatus_profile extends Memcached_DataObject
} else if ($actor->id) {
// We have an ActivityStreams actor with an explicit ID that doesn't match the feed owner.
// This isn't what we expect from mainline OStatus person feeds!
- // Group feeds go down another path, with different validation.
- throw new Exception("Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}");
+ // Group feeds go down another path, with different validation...
+ // Most likely this is a plain ol' blog feed of some kind which
+ // doesn't match our expectations. We'll take the entry, but ignore
+ // the <author> info.
+ common_log(LOG_WARNING, "Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}");
} else {
// Plain <author> without ActivityStreams actor info.
// We'll just ignore this info for now and save the update under the feed's identity.
diff --git a/plugins/OStatus/lib/discoveryhints.php b/plugins/OStatus/lib/discoveryhints.php
index 34c9be277..fa2ead732 100644
--- a/plugins/OStatus/lib/discoveryhints.php
+++ b/plugins/OStatus/lib/discoveryhints.php
@@ -114,9 +114,10 @@ class DiscoveryHints {
static function _hcard($body, $url)
{
- // DOMDocument::loadHTML may throw warnings on unrecognized elements.
+ // DOMDocument::loadHTML may throw warnings on unrecognized elements,
+ // and notices on unrecognized namespaces.
- $old = error_reporting(error_reporting() & ~E_WARNING);
+ $old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
$doc = new DOMDocument();
$doc->loadHTML($body);
diff --git a/plugins/OStatus/lib/feeddiscovery.php b/plugins/OStatus/lib/feeddiscovery.php
index a55399d7c..8a166a0be 100644
--- a/plugins/OStatus/lib/feeddiscovery.php
+++ b/plugins/OStatus/lib/feeddiscovery.php
@@ -196,8 +196,9 @@ class FeedDiscovery
*/
function discoverFromHTML($url, $body)
{
- // DOMDocument::loadHTML may throw warnings on unrecognized elements.
- $old = error_reporting(error_reporting() & ~E_WARNING);
+ // DOMDocument::loadHTML may throw warnings on unrecognized elements,
+ // and notices on unrecognized namespaces.
+ $old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
$dom = new DOMDocument();
$ok = $dom->loadHTML($body);
error_reporting($old);
diff --git a/plugins/SubMirror/actions/basemirror.php b/plugins/SubMirror/actions/basemirror.php
index 5be0699f0..be6942efa 100644
--- a/plugins/SubMirror/actions/basemirror.php
+++ b/plugins/SubMirror/actions/basemirror.php
@@ -92,7 +92,13 @@ abstract class BaseMirrorAction extends Action
*/
protected function profileForFeed($url)
{
- $oprofile = Ostatus_profile::ensureProfileURL($url);
+ try {
+ // Maybe we got a web page?
+ $oprofile = Ostatus_profile::ensureProfileURL($url);
+ } catch (Exception $e) {
+ // Direct feed URL?
+ $oprofile = Ostatus_profile::ensureFeedURL($url);
+ }
if ($oprofile->isGroup()) {
$this->clientError(_m("Can't mirror a StatusNet group at this time."));
}