Skip to content

Commit

Permalink
#2286 document/comment 이미지 교체 시 썸네일의 cache를 갱신하기 위한 URL parameter 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bnu committed Aug 31, 2018
1 parent 1c0ca4d commit 355e229
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions modules/comment/comment.item.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function getThumbnail($width = 80, $height = 0, $thumbnail_type = '')
}
else
{
return $thumbnail_url;
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
}
}

Expand Down Expand Up @@ -685,18 +685,13 @@ function getThumbnail($width = 80, $height = 0, $thumbnail_type = '')
// Remove lockfile
FileHandler::removeFile($thumbnail_lockfile);

// Return the thumbnail path if it was successfully generated
if($output)
{
return $thumbnail_url;
}
// Create an empty file if thumbnail generation failed
else
if(!$output)
{
FileHandler::writeFile($thumbnail_file, '','w');
}

return;
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
}

function isCarted()
Expand Down
11 changes: 3 additions & 8 deletions modules/document/document.item.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ function getThumbnail($width = 80, $height = 0, $thumbnail_type = '')
}
else
{
return $thumbnail_url;
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
}
}

Expand Down Expand Up @@ -959,18 +959,13 @@ function getThumbnail($width = 80, $height = 0, $thumbnail_type = '')
// Remove lockfile
FileHandler::removeFile($thumbnail_lockfile);

// Return the thumbnail path if it was successfully generated
if($output_file)
{
return $thumbnail_url;
}
// Create an empty file if thumbnail generation failed
else
if(!$output_file)
{
FileHandler::writeFile($thumbnail_file, '','w');
}

return;
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
}

/**
Expand Down

0 comments on commit 355e229

Please sign in to comment.