From: Tim Düsterhus Date: Wed, 13 Mar 2019 16:39:00 +0000 (+0100) Subject: Improve comments for attachment location compatibility layer X-Git-Tag: 5.2.0_Alpha_1~219^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8138e621c96291e743ab04c776bab2df81d14bb8;p=GitHub%2FWoltLab%2FWCF.git Improve comments for attachment location compatibility layer see #2840 see #2869 --- diff --git a/wcfsetup/install/files/lib/data/attachment/Attachment.class.php b/wcfsetup/install/files/lib/data/attachment/Attachment.class.php index f739ea934e..f7bae162cb 100644 --- a/wcfsetup/install/files/lib/data/attachment/Attachment.class.php +++ b/wcfsetup/install/files/lib/data/attachment/Attachment.class.php @@ -151,7 +151,10 @@ class Attachment extends DatabaseObject implements IRouteController, IThumbnailF } /** - * Migrates the storage location of this attachment. + * Migrates the storage location of this attachment to + * include the `.bin` suffix. + * + * @since 5.2 */ public function migrateStorage() { foreach ([$this->getLocation(), $this->getThumbnailLocation(), $this->getThumbnailLocation('tiny')] as $location) { @@ -164,20 +167,22 @@ class Attachment extends DatabaseObject implements IRouteController, IThumbnailF /** * Returns the appropriate location with or without extension. * + * Files are suffixed with `.bin` since 5.2, but they are recognized + * without the extension for backward compatibility. + * * @param string $location * @return string + * @since 5.2 */ protected final function getLocationHelper($location) { - // Check location with extension if (is_readable($location.'.bin')) { return $location.'.bin'; } - // Check legacy location else if (is_readable($location)) { return $location; } - // Assume that the attachment is not yet uploaded. + // Assume that the attachment has not been uploaded yet. return $location.'.bin'; }