Improve duplicate check
This commit is contained in:
parent
c92a333b17
commit
c4f1719e8d
1 changed files with 10 additions and 2 deletions
|
@ -154,9 +154,17 @@ class Processor
|
|||
|
||||
$filetype = strtolower(substr($attach['mediaType'], 0, strpos($attach['mediaType'], '/')));
|
||||
if ($filetype == 'image') {
|
||||
if (!empty($activity['source']) && strpos($activity['source'], $attach['url'])) {
|
||||
if (!empty($activity['source'])) {
|
||||
foreach ([0, 1, 2] as $size) {
|
||||
if (preg_match('#/photo/.*-' . $size . '\.#ism', $attach['url']) &&
|
||||
strpos(preg_replace('#(/photo/.*)-[012]\.#ism', '$1-' . $size . '.', $activity['source']), $attach['url'])) {
|
||||
continue 3;
|
||||
}
|
||||
}
|
||||
if (strpos($activity['source'], $attach['url'])) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$item['body'] .= "\n";
|
||||
|
||||
|
|
Loading…
Reference in a new issue