Fixed title of embedded media (non-images)
authorMarcel Werk <burntime@woltlab.com>
Sun, 4 Dec 2016 20:00:47 +0000 (21:00 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 4 Dec 2016 20:00:47 +0000 (21:00 +0100)
wcfsetup/install/files/lib/data/media/ViewableMedia.class.php

index 38c4b5e11a97cb25a8e2f6a3d10ee8d3a99c1341..fae20b0e712981b74eaef773a6fdbd10c8319d6a 100644 (file)
@@ -32,6 +32,17 @@ class ViewableMedia extends DatabaseObjectDecorator {
         */
        protected static $baseClass = Media::class;
        
+       /**
+        * @inheritDoc
+        */
+       public function getTitle() {
+               if ($this->title){
+                       return $this->title;
+               }
+               
+               return $this->getDecoratedObject()->getTitle();
+       }
+       
        /**
         * Returns a textual representation of the media file to be used in templates.
         *