Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.0.0 DXP FP9
-
7.1.x, 7.0.x
-
Committed
-
0.25
-
4
Description
Summary
When creating a Web Content, we have the option to add a file in the Content section. It seems that the file chooser, or the Documents and Media uploader allows any file to be uploaded, when in reality it expects an image file.
Because of the open parameters (no restrictions on image type/extension), it seems unexpected when the Web Content add file functionality sets an img attribute in the HTML source.
Steps to Reproduce
1. Start up clean Liferay DXP SP1 bundle
2. Sign in as the administrator
3. In the default Liferay DXP site, go into Contents > Web Content
4. Add a new Web Content
5. Assign a title, and in the Content section, click +
6. Click the first icon (indicating an image/file icon)
7. In the file uploader, click Choose a file, and select a TXT file
8. After the file uploads, assert that a broken image icon is present
9. Check the source code of the Web Content editor
Actual Result
An img src is set for the text file
<p><img src="http://localhost:7080/documents/20143/0/Sample.txt/62ea9504-cc11-7c2d-09c7-747399d8bcf7?version=1.0" /></p>
Expected Result
Either (1) make it clear that non-image files cannot be uploaded/used and set these limits on the file chooser, or (2) parse non-image links to be displayed as links to the downloadable file.