Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
56 | protected function fixExtension($string) |
||
57 | { |
||
58 | $supportedImageExtensions = Image::get_category_extensions( |
||
59 | Image::singleton()->File->getAllowedCategories() |
||
60 | ); |
||
61 | $extension = pathinfo($string)['extension']; |
||
62 | |||
63 | if (!in_array($extension, $supportedImageExtensions)) { |
||
64 | return str_replace( |
||
65 | '.' . $extension, |
||
66 | '.' . $this->owner->config()->get('defaultImageType'), |
||
67 | $string |
||
68 | ); |
||
69 | } |
||
70 | |||
71 | return $string; |
||
72 | } |
||
74 |