Make crop editor usable #22

Merged
Aaron merged 27 commits from crop-editor into master 2020-12-30 20:06:17 +01:00
Showing only changes of commit b8191bf554 - Show all commits

View File

@ -118,7 +118,7 @@ class EditAsset extends HTMLController
// Does the thumbnail exist on disk? If not, use an url to generate it.
if (!$filename || !file_exists(THUMBSDIR . '/' . $subdir . '/' . $filename))
$thumb_url = BASEURL . '/thumbnail/' . $image->getId() . '/' . $thumb['width'] . 'x' . $thumb['height'] . $thumb['suffix'] . '/';
$thumb_url = BASEURL . '/thumbnail/' . $image->getId() . '/' . $thumb['width'] . 'x' . $thumb['height'] . ($thumb['suffix'] ?? '') . '/';
Aaron marked this conversation as resolved
Review

Edge case: suffix can be null, as the group is optional in the regex. Handle this.

Edge case: `suffix` can be null, as the group is optional in the regex. Handle this.
else
$thumb_url = THUMBSURL . '/' . $subdir . '/' . $filename;