From b89878511f1f30b4e18858940a5468b8999ab7ea Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 23 Oct 2009 20:31:53 +0000 Subject: [PATCH 1/2] Fix three fatal errors when posting from 0.9.x: * OMB remote updates were trying to load nonexistent Laconica_OMB_Service_Consumer class -- fixed to StatusNet_OMB_Service_Consumer. Regression caused during libomb merge. * Twitter processing was still being queued from core when no twitter plugin was present, which triggered an exception from UnqueueHandler; leftover code from before the plugin extraction. * UnqueueHandler's exception caused a fatal error instead because it was missing the "new" keyword. Wouldn't have been seen when testing with the plugin enabled. --- lib/omb.php | 2 +- lib/unqueuemanager.php | 2 +- lib/util.php | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/omb.php b/lib/omb.php index 0566701ff1..cd6d6e1b25 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -87,7 +87,7 @@ function omb_broadcast_notice($notice) common_debug('Posting to ' . $rp->postnoticeurl, __FILE__); /* Post notice. */ - $service = new Laconica_OMB_Service_Consumer( + $service = new StatusNet_OMB_Service_Consumer( array(OMB_ENDPOINT_POSTNOTICE => $rp->postnoticeurl)); try { $service->setToken($rp->token, $rp->secret); diff --git a/lib/unqueuemanager.php b/lib/unqueuemanager.php index 51261bcd71..6c26fac0ed 100644 --- a/lib/unqueuemanager.php +++ b/lib/unqueuemanager.php @@ -72,7 +72,7 @@ class UnQueueManager break; default: if (Event::handle('UnqueueHandleNotice', array(&$notice, $queue))) { - throw ServerException("UnQueueManager: Unknown queue: $queue"); + throw new ServerException("UnQueueManager: Unknown queue: $queue"); } } } diff --git a/lib/util.php b/lib/util.php index e641afd4db..55ded7dd4e 100644 --- a/lib/util.php +++ b/lib/util.php @@ -906,7 +906,6 @@ function common_broadcast_notice($notice, $remote=false) function common_enqueue_notice($notice) { static $localTransports = array('omb', - 'twitter', 'facebook', 'ping'); From ff4f9d8c7d6d1d5c4a69d75924e4da67a883db44 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 23 Oct 2009 13:50:39 -0700 Subject: [PATCH 2/2] Fix an incorrectly passing URL test case and add two a related test case: URLs with paths followed by a double-quote character are incorrectly including the quote in the URL. The double-quote character is in fact not a legal URL char and must be URL-escaped; more importantly it just causes oddities when you quote a message ending in a URL -- such as when using the redent-button experimental feature. --- tests/URLDetectionTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/URLDetectionTest.php b/tests/URLDetectionTest.php index 45203bf6e3..0cc03ccce7 100644 --- a/tests/URLDetectionTest.php +++ b/tests/URLDetectionTest.php @@ -47,7 +47,9 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase array('127.0.0.1/\'test', '127.0.0.1/\'test'), array('127.0.0.1/"test', - '127.0.0.1/"test'), + '127.0.0.1/"test'), + array('127.0.0.1/test"test', + '127.0.0.1/test"test'), array('127.0.0.1/-test', '127.0.0.1/-test'), array('127.0.0.1/_test', @@ -170,6 +172,8 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase '\'http://example.com\''), array('"http://example.com"', '"http://example.com"'), + array('"http://example.com/"', + '"http://example.com/"'), array('http://example.com', 'http://example.com'), array('(http://example.com)',