Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion type extension issue #31

Closed
cybernotic opened this issue Sep 1, 2020 · 3 comments
Closed

Conversion type extension issue #31

cybernotic opened this issue Sep 1, 2020 · 3 comments

Comments

@cybernotic
Copy link

Hi Matt,
I have just come across potential issues involving extension type names. If a file has a uppercase extension (which sometimes occur with image files) this will fail as an unrecognised format because the list of supported import file formats are in lowercase.

I tested this by changing a file extension (xxx.png) to uppercase and then back to lowercase.
So, would it be worth while to implement a strtolower() somewhere to capture the filename extension before it's checked against the supported list?

What are your thoughts on this?

Regards
David

@aspark21
Copy link
Contributor

aspark21 commented Nov 6, 2020

Quick update on this we looked at getting that fixed in core but apparently it's up to each plugin to address (https://tracker.moodle.org/browse/MDL-69616)

I think it'll also explains #41 as a lot of phones save image filetypes in capitals - that's how we came across it

@juancartagena
Copy link

This can be fixed here https://github.com/catalyst/moodle-fileconverter_librelambda/blob/master/classes/converter.php#L424 including the strtolower function:

    public static function supports($from, $to) {
        // This is not a one-liner because of php 5.6.
        $imports = self::$imports;
        $exports = self::$exports;
        return isset($imports[\core_text::strtolower($from)]) && isset($exports[$to]);
    }

@tuanngocnguyen
Copy link
Contributor

Hi all,

I am closing this issue as it is fixed on: #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants