| @@ 588-598 (lines=11) @@ | ||
| 585 | $thumbnail_url = Context::getRequestUri() . $thumbnail_file; |
|
| 586 | ||
| 587 | // return false if a size of existing thumbnail file is 0. otherwise return the file path |
|
| 588 | if(file_exists($thumbnail_file) || file_exists($thumbnail_lockfile)) |
|
| 589 | { |
|
| 590 | if(filesize($thumbnail_file) < 1) |
|
| 591 | { |
|
| 592 | return FALSE; |
|
| 593 | } |
|
| 594 | else |
|
| 595 | { |
|
| 596 | return $thumbnail_url; |
|
| 597 | } |
|
| 598 | } |
|
| 599 | ||
| 600 | // Create lockfile to prevent race condition |
|
| 601 | FileHandler::writeFile($thumbnail_lockfile, '', 'w'); |
|
| @@ 857-867 (lines=11) @@ | ||
| 854 | $thumbnail_url = Context::getRequestUri().$thumbnail_file; |
|
| 855 | ||
| 856 | // Return false if thumbnail file exists and its size is 0. Otherwise, return its path |
|
| 857 | if(file_exists($thumbnail_file) || file_exists($thumbnail_lockfile)) |
|
| 858 | { |
|
| 859 | if(filesize($thumbnail_file) < 1) |
|
| 860 | { |
|
| 861 | return FALSE; |
|
| 862 | } |
|
| 863 | else |
|
| 864 | { |
|
| 865 | return $thumbnail_url; |
|
| 866 | } |
|
| 867 | } |
|
| 868 | ||
| 869 | // Create lockfile to prevent race condition |
|
| 870 | FileHandler::writeFile($thumbnail_lockfile, '', 'w'); |
|