]> git.mxchange.org Git - friendica.git/commitdiff
repair any bad links in activity objects
authorFriendika <info@friendika.com>
Tue, 18 Jan 2011 00:28:32 +0000 (16:28 -0800)
committerFriendika <info@friendika.com>
Tue, 18 Jan 2011 00:28:32 +0000 (16:28 -0800)
boot.php
update.php

index d168a2b8e27748ce54821de047c812a44af53662..13e1e17936b34ad0fe583480eaf836f3237da001 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,8 +2,8 @@
 
 set_time_limit(0);
 
-define ( 'BUILD_ID',               1031   );
-define ( 'FRIENDIKA_VERSION',      '2.01.1002' );
+define ( 'BUILD_ID',               1032   );
+define ( 'FRIENDIKA_VERSION',      '2.01.1003' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.0'  );
 
 define ( 'EOL',                    "<br />\r\n"     );
index ae0e35531d358469ba6ce3b89e85e36912379305..7aacffb40be21942c8a1209168083923280b4f4e 100644 (file)
@@ -302,3 +302,18 @@ function update_1030() {
 
 }
 
+function update_1031() {
+       // Repair any bad links that slipped into the item table
+       $r = q("SELECT `id`, `object` FROM `item` WHERE `object` != '' ");
+       if($r && count($r)) {
+               foreach($r as $rr) {
+                       if(strstr($rr['object'],'type=&quot;http')) {
+                               q("UPDATE `item` SET `object` = '%s' WHERE `id` = %d LIMIT 1",
+                                       dbesc(str_replace('type=&quot;http','href=&quot;http',$rr['object'])),
+                                       intval($rr['id'])
+                               );
+                       }
+               }
+       }
+}
+