Skip to content

Commit 34d6d55

Browse files
committed
Fix config backend model PDF file name extension
1 parent 0053757 commit 34d6d55

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Config\Model\Config\Backend\Image;
8+
9+
/**
10+
* @api
11+
*/
12+
class Pdf extends \Magento\Config\Model\Config\Backend\File
13+
{
14+
/**
15+
* @return string[]
16+
*/
17+
protected function _getAllowedExtensions()
18+
{
19+
return ['pdf'];
20+
}
21+
}

app/code/Magento/Config/Model/Config/Backend/Image/Pdf.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* System config image field backend model for Zend PDF generator
9-
*
10-
* @author Magento Core Team <[email protected]>
11-
*/
127
namespace Magento\Config\Model\Config\Backend\Image;
138

149
/**
1510
* @api
16-
* @since 100.0.2
11+
* @deprecated The wrong file type extensions are returned.
12+
* @see \Magento\Config\Model\Config\Backend\File\Pdf
1713
*/
1814
class Pdf extends \Magento\Config\Model\Config\Backend\Image
1915
{
@@ -22,6 +18,6 @@ class Pdf extends \Magento\Config\Model\Config\Backend\Image
2218
*/
2319
protected function _getAllowedExtensions()
2420
{
25-
return ['tif', 'tiff', 'png', 'jpg', 'jpe', 'jpeg'];
21+
return ['tif', 'tiff', 'png', 'jpg', 'jpe', 'jpeg', 'pdf'];
2622
}
2723
}

0 commit comments

Comments
 (0)