1
1
Fork 0

repair any bad links in activity objects

This commit is contained in:
Friendika 2011-01-17 16:28:32 -08:00
commit 050618a2b6
2 changed files with 17 additions and 2 deletions

View 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="http')) {
q("UPDATE `item` SET `object` = '%s' WHERE `id` = %d LIMIT 1",
dbesc(str_replace('type="http','href="http',$rr['object'])),
intval($rr['id'])
);
}
}
}
}