Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug in twitter POSSE code where was parsing twitter inReplyTo U…

…RLs for /status/ instead of /statuses/
  • Loading branch information...
commit e50fbf1c1a3ebe30db0f8366dca73e0760451df7 1 parent b873bba
@barnabywalters authored
View
2  BarnabyWalters/Posse/EventListener/TwitterSyndicator.php
@@ -151,6 +151,8 @@ public function setGuzzle(\Guzzle\Http\ClientInterface $client) {
* This function performs no truncation at any stage. Use THE TRUNCENATOR or
* similar for that.
*
+ * @todo write tests
+ *
* @param \ActivityStreams\ActivityStreams\ObjectInterface $object
* @return string
*/
View
2  BarnabyWalters/Posse/Helpers.php
@@ -55,7 +55,7 @@ public static function prepareForTwitter($text, $url = null, $inReplyTo = null)
if ($inReplyTo !== null) {
// Check if there’s a twitter status ID in the URL to use
- $tweetPattern = '/https?:\/\/twitter.com\/[a-zA-Z_]{1,20}\/status\/([0-9]*)/';
+ $tweetPattern = '/https?:\/\/twitter.com\/[a-zA-Z_]{1,20}\/statuses\/([0-9]*)/';
$matches = array();
preg_match($tweetPattern, $inReplyTo, $matches);
View
2  tests/BarnabyWalters/Posse/HelpersTest.php
@@ -21,7 +21,7 @@ class HelpersTest extends \PHPUnit_Framework_TestCase {
public function testPrepareContentForTwitter() {
$text = 'Lots and lots and lots of very long text Lots and lots and lots of very long text Lots and lots and lots of very long text';
$url = 'http://example.com';
- $inReplyTo = 'https://twitter.com/someuser/status/100';
+ $inReplyTo = 'https://twitter.com/someuser/statuses/100';
$result = Helpers::prepareForTwitter($text, $url, $inReplyTo);
Please sign in to comment.
Something went wrong with that request. Please try again.