]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' into 0.9.x
authorBrion Vibber <brion@pobox.com>
Mon, 28 Feb 2011 18:18:18 +0000 (10:18 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 28 Feb 2011 18:18:18 +0000 (10:18 -0800)
classes/Notice.php
classes/statusnet.ini
lib/util.php
plugins/TwitterBridge/twitterimport.php
tests/URLDetectionTest.php

index a25991fa322fc779d17299fa5944ba2a7a9caaa8..141ae8fd44883c3cb012214fd1a35b239d33801e 100644 (file)
@@ -1072,6 +1072,7 @@ class Notice extends Memcached_DataObject
 
             $reply->notice_id  = $this->id;
             $reply->profile_id = $profile->id;
+            $reply->modified   = $this->created;
 
             common_log(LOG_INFO, __METHOD__ . ": saving reply: notice $this->id to profile $profile->id");
 
@@ -1132,6 +1133,7 @@ class Notice extends Memcached_DataObject
 
                 $reply->notice_id  = $this->id;
                 $reply->profile_id = $mentioned->id;
+                $reply->modified   = $this->created;
 
                 $id = $reply->insert();
 
index ef631e28d376668940e579f05cc0a300ad14cab4..1916c2513972aa78339b3d5270c31524eee10f7d 100644 (file)
@@ -502,7 +502,8 @@ uri = U
 [reply]
 notice_id = 129
 profile_id = 129
-modified = 384
+modified = 142
+;modified = 384 ; skipping the mysql_timestamp mode so we can override its setting
 replied_id = 1
 
 [reply__keys]
index f734062eced327cec4423eaf9732634778af207d..e5b0c86e06160599436901a3f84c4a8717d2932e 100644 (file)
@@ -925,11 +925,11 @@ function common_linkify($url) {
     // functions
     $url = htmlspecialchars_decode($url);
 
-   if(strpos($url, '@') !== false && strpos($url, ':') === false) {
-       //url is an email address without the mailto: protocol
-       $canon = "mailto:$url";
-       $longurl = "mailto:$url";
-   }else{
+    if (strpos($url, '@') !== false && strpos($url, ':') === false && Validate::email($url)) {
+        //url is an email address without the mailto: protocol
+        $canon = "mailto:$url";
+        $longurl = "mailto:$url";
+    } else {
 
         $canon = File_redirection::_canonUrl($url);
 
index 5ddf5380d745128a2057a6085bb1a01435b1bb74..0eacfcd62c57cf10dc05350dc0a52ff88347d726 100644 (file)
@@ -675,6 +675,7 @@ class TwitterImport
                     $reply = new Reply();
                     $reply->notice_id  = $notice->id;
                     $reply->profile_id = $user->id;
+                    $reply->modified   = $notice->created;
                     common_log(LOG_INFO, __METHOD__ . ": saving reply: notice {$notice->id} to profile {$user->id}");
                     $id = $reply->insert();
                 }
index eac7ba3f5c766032ad14d5d5103793299e5458b0..dc017ac616f63bdd2fcae5c607c6f4db0978c090 100644 (file)
@@ -20,6 +20,8 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
     public function testProduction($content, $expected)
     {
         $rendered = common_render_text($content);
+        // hack!
+        $rendered = preg_replace('/id="attachment-\d+"/', 'id="attachment-XXX"', $rendered);
         $this->assertEquals($expected, $rendered);
     }
 
@@ -269,7 +271,13 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
                      array('file.html',
                            'file.html'),
                      array('file.php',
-                           'file.php')
+                           'file.php'),
+
+                     // scheme-less HTTP URLs with @ in the path: http://status.net/open-source/issues/2248
+                     array('http://flickr.com/photos/34807140@N05/3838905434',
+                           '<a href="http://flickr.com/photos/34807140@N05/3838905434" title="http://flickr.com/photos/34807140@N05/3838905434" class="attachment thumbnail" id="attachment-XXX" rel="nofollow external">http://flickr.com/photos/34807140@N05/3838905434</a>'),
+                     array('flickr.com/photos/34807140@N05/3838905434',
+                           '<a href="http://flickr.com/photos/34807140@N05/3838905434" title="http://flickr.com/photos/34807140@N05/3838905434" class="attachment thumbnail" id="attachment-XXX" rel="nofollow external">flickr.com/photos/34807140@N05/3838905434</a>'),
                      );
     }
 }