Improve comments for attachment location compatibility layer
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 13 Mar 2019 16:39:00 +0000 (17:39 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 13 Mar 2019 16:39:32 +0000 (17:39 +0100)
see #2840
see #2869

wcfsetup/install/files/lib/data/attachment/Attachment.class.php

index f739ea934ee3daf19933896acc6e37697f7046ab..f7bae162cb77a8f1d1d2e3bf943dcbc33eee7b68 100644 (file)
@@ -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';
        }