From 050618a2b690ad2e2d8e84afbada8b12f9da0f01 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 17 Jan 2011 16:28:32 -0800 Subject: repair any bad links in activity objects --- update.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'update.php') diff --git a/update.php b/update.php index ae0e35531..7aacffb40 100644 --- a/update.php +++ b/update.php @@ -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="http')) { + q("UPDATE `item` SET `object` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(str_replace('type="http','href="http',$rr['object'])), + intval($rr['id']) + ); + } + } + } +} + -- cgit v1.2.3