File tree 1 file changed +12
-15
lines changed
app/code/Magento/Downloadable/Helper 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -183,26 +183,23 @@ public function getFileSize()
183
183
*
184
184
* @return string
185
185
*/
186
- public function getContentType ()
186
+ public function getContentType ()
187
187
{
188
188
$ this ->_getHandle ();
189
- if ($ this ->_linkType == self ::LINK_TYPE_FILE ) {
190
- if (function_exists (
191
- 'mime_content_type '
192
- ) && ($ contentType = mime_content_type (
193
- $ this ->_workingDirectory ->getAbsolutePath ($ this ->_resourceFile )
194
- ))
189
+ if ($ this ->_linkType === self ::LINK_TYPE_FILE ) {
190
+ if (function_exists ('mime_content_type ' )
191
+ && ($ contentType = mime_content_type (
192
+ $ this ->_workingDirectory ->getAbsolutePath ($ this ->_resourceFile )
193
+ ))
195
194
) {
196
195
return $ contentType ;
197
- } else {
198
- return $ this ->_downloadableFile ->getFileType ($ this ->_resourceFile );
199
- }
200
- } elseif ($ this ->_linkType == self ::LINK_TYPE_URL ) {
201
- if (is_array ($ this ->_handle ->stat ($ this ->_resourceFile )['type ' ])) {
202
- return end ($ this ->_handle ->stat ($ this ->_resourceFile )['type ' ]);
203
- } else {
204
- return $ this ->_handle ->stat ($ this ->_resourceFile )['type ' ];
205
196
}
197
+ return $ this ->_downloadableFile ->getFileType ($ this ->_resourceFile );
198
+ }
199
+ if ($ this ->_linkType === self ::LINK_TYPE_URL ) {
200
+ return (is_array ($ this ->_handle ->stat ($ this ->_resourceFile )['type ' ])
201
+ ? end ($ this ->_handle ->stat ($ this ->_resourceFile )['type ' ])
202
+ : $ this ->_handle ->stat ($ this ->_resourceFile )['type ' ]);
206
203
}
207
204
return $ this ->_contentType ;
208
205
}
You can’t perform that action at this time.
0 commit comments