forked from GNUsocial/gnu-social
incorrect use of match results
darcs-hash:20081124040224-84dde-ca5e732949bf2f837b4d99f7fe705f0fd74b9a48.gz
This commit is contained in:
parent
48c2d39ae4
commit
02573ef6ce
26
lib/util.php
26
lib/util.php
@ -1326,24 +1326,26 @@ function common_save_replies($notice) {
|
|||||||
$replied[$recipient->id] = 1;
|
$replied[$recipient->id] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Hash format replies, too
|
# Hash format replies, too
|
||||||
$cnt = preg_match_all('/(?:^|\s)@#([a-z0-9]{1,64})/', $notice->content, $match);
|
$cnt = preg_match_all('/(?:^|\s)@#([a-z0-9]{1,64})/', $notice->content, $match);
|
||||||
foreach ($match as $tag) {
|
if ($cnt) {
|
||||||
$tagged = Profile_tag::getTagged($sender->id, $tag);
|
foreach ($match[1] as $tag) {
|
||||||
foreach ($tagged as $t) {
|
$tagged = Profile_tag::getTagged($sender->id, $tag);
|
||||||
if (!$replied[$t->id]) {
|
foreach ($tagged as $t) {
|
||||||
$reply = new Reply();
|
if (!$replied[$t->id]) {
|
||||||
$reply->notice_id = $notice->id;
|
$reply = new Reply();
|
||||||
$reply->profile_id = $t->id;
|
$reply->notice_id = $notice->id;
|
||||||
$id = $reply->insert();
|
$reply->profile_id = $t->id;
|
||||||
if (!$id) {
|
$id = $reply->insert();
|
||||||
common_log_db_error($reply, 'INSERT', __FILE__);
|
if (!$id) {
|
||||||
return;
|
common_log_db_error($reply, 'INSERT', __FILE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_broadcast_notice($notice, $remote=false) {
|
function common_broadcast_notice($notice, $remote=false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user