mirror of
https://github.com/friendica/friendica
synced 2025-04-20 19:50:12 +00:00
Ward againt contact_id = 0 in UpdateContact worker
- Add parameter validation in Worker\UpdateContact::add - Address https://github.com/friendica/friendica/issues/12487#issuecomment-1366833644
This commit is contained in:
parent
5af956b92f
commit
e563de4de7
5 changed files with 71 additions and 17 deletions
|
@ -44,6 +44,7 @@ use Friendica\Util\Images;
|
|||
use Friendica\Util\Network;
|
||||
use Friendica\Util\ParseUrl;
|
||||
use Friendica\Util\Proxy;
|
||||
use Friendica\Worker\UpdateContact;
|
||||
|
||||
/**
|
||||
* Photo Module
|
||||
|
@ -351,8 +352,12 @@ class Photo extends BaseModule
|
|||
Logger::debug('Got return code for avatar', ['return code' => $curlResult->getReturnCode(), 'cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
|
||||
}
|
||||
if ($update) {
|
||||
Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
|
||||
Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id);
|
||||
try {
|
||||
UpdateContact::add(Worker::PRIORITY_LOW, $id);
|
||||
Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
Logger::notice($e->getMessage(), ['id' => $id, 'contact' => $contact]);
|
||||
}
|
||||
} else {
|
||||
Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue