Skip to content
Permalink
Browse files

fixed duplicate pictures cleanup; updates #251

  • Loading branch information...
following5 committed Jan 5, 2016
1 parent c74a429 commit 8cf4f41b4859b666ad95eb4f036e67539e5f38e3
Showing with 3 additions and 2 deletions.
  1. +3 −2 htdocs/util2/cron/modules/picture_cleanup.class.php
@@ -44,10 +44,10 @@ function run()
}
for ($n = 1; $n < count($instances); ++$n)
if ($instances[$n]['filesize'] !== FALSE) // ensure that pic is stored locally
if ($instances[$n]['filesize'] !== false) // ensure that pic is stored locally
{
for ($nn = $n-1; $nn >= 0; --$nn)
if ($instances[$nn]['filesize'] == $instances[$n]['filesize'])
if ($instances[$nn]['filesize'] === $instances[$n]['filesize'])
if (file_get_contents($instances[$nn]['pic']->getFilename())
== file_get_contents($instances[$n]['pic']->getFilename()))
{
@@ -56,6 +56,7 @@ function run()
' from log ' . $rDuplicatePic['object_id'] .
' of cache ' . $instances[$n]['cache_id'] . "\n";
$picture->delete(false);
$instances[$n]['filesize'] = false;
break;
}
}

0 comments on commit 8cf4f41

Please sign in to comment.
You can’t perform that action at this time.