| @@ 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 . '?' . date('YmdHis', filemtime($thumbnail_file)); |
|
| 597 | } |
|
| 598 | } |
|
| 599 | ||
| 600 | // Create lockfile to prevent race condition |
|
| 601 | FileHandler::writeFile($thumbnail_lockfile, '', 'w'); |
|
| @@ 863-873 (lines=11) @@ | ||
| 860 | $thumbnail_url = Context::getRequestUri().$thumbnail_file; |
|
| 861 | ||
| 862 | // Return false if thumbnail file exists and its size is 0. Otherwise, return its path |
|
| 863 | if(file_exists($thumbnail_file) || file_exists($thumbnail_lockfile)) |
|
| 864 | { |
|
| 865 | if(filesize($thumbnail_file) < 1) |
|
| 866 | { |
|
| 867 | return FALSE; |
|
| 868 | } |
|
| 869 | else |
|
| 870 | { |
|
| 871 | return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file)); |
|
| 872 | } |
|
| 873 | } |
|
| 874 | ||
| 875 | // Create lockfile to prevent race condition |
|
| 876 | FileHandler::writeFile($thumbnail_lockfile, '', 'w'); |
|