mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
split up a potentially long running sql query
This commit is contained in:
@@ -1389,14 +1389,20 @@ class Libzot {
|
||||
$r = [];
|
||||
$thread_parent = self::find_parent($env, $act);
|
||||
if ($thread_parent) {
|
||||
$z = q("select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = '%s' OR item.parent_mid = '%s' ) and channel_hash != '%s'",
|
||||
$uids = q("SELECT uid FROM item WHERE thr_parent = '%s' OR parent_mid = '%s'",
|
||||
dbesc($thread_parent),
|
||||
dbesc($thread_parent),
|
||||
dbesc($env['sender'])
|
||||
dbesc($thread_parent)
|
||||
);
|
||||
|
||||
$uids = ids_to_querystr($uids, 'uid');
|
||||
|
||||
$z = q("SELECT channel_hash FROM channel WHERE channel_hash != '%s' AND channel_id IN ($uids)",
|
||||
dbesc($msg['sender'])
|
||||
);
|
||||
|
||||
if ($z) {
|
||||
foreach ($z as $zv) {
|
||||
$r[] = $zv['hash'];
|
||||
$r[] = $zv['channel_hash'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3322,6 +3322,8 @@ function item_url_replace($channel,&$item,$old,$new,$oldnick = '') {
|
||||
$root_replaced = null;
|
||||
$nick_replaced = null;
|
||||
|
||||
// FIXME: ignore anything in a share tag
|
||||
|
||||
$item['body'] = str_replace($old, $new, $item['body'], $root_replaced);
|
||||
|
||||
if($oldnick && ($oldnick !== $channel['channel_address'])) {
|
||||
|
||||
Reference in New Issue
Block a user