Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
10cc00b4
Commit
10cc00b4
authored
Dec 11, 2017
by
Andrew Nicols
Browse files
Merge branch 'MDL-58272-master-2' of
https://github.com/snake/moodle
parents
67c0e18c
46878ed8
Changes
2
Hide whitespace changes
Inline
Side-by-side
files/classes/converter.php
View file @
10cc00b4
...
...
@@ -127,7 +127,7 @@ class converter {
if
(
$status
===
conversion
::
STATUS_PENDING
||
$status
===
conversion
::
STATUS_FAILED
)
{
// The current status is either pending or failed.
// Attempt to pick up a new converter and convert the document.
$from
=
\
core_filetypes
::
get_file_extension
(
$file
->
get_mimetype
()
);
$from
=
pathinfo
(
$file
->
get_filename
(),
PATHINFO_EXTENSION
);
$converters
=
$this
->
get_document_converter_classes
(
$from
,
$format
);
$currentconverter
=
$this
->
get_next_converter
(
$converters
,
$conversion
->
get
(
'converter'
));
...
...
@@ -225,9 +225,9 @@ class converter {
return
false
;
}
$from
=
\
core_filetypes
::
get_file_extension
(
$file
->
get_mimetype
()
);
$from
=
pathinfo
(
$file
->
get_filename
(),
PATHINFO_EXTENSION
);
if
(
!
$from
)
{
// No
mime type
could be found. Unable to determine converter.
// No
file extension
could be found. Unable to determine converter.
return
false
;
}
...
...
files/tests/converter_test.php
View file @
10cc00b4
...
...
@@ -341,7 +341,7 @@ class core_files_converter_testcase extends advanced_testcase {
}
/**
* Test the can_convert_storedfile_to function with a file with
indistinguished mimetype
.
* Test the can_convert_storedfile_to function with a file with
a known mimetype and extension
.
*/
public
function
test_can_convert_storedfile_to_docx
()
{
$returnvalue
=
(
object
)
[];
...
...
@@ -352,8 +352,7 @@ class core_files_converter_testcase extends advanced_testcase {
$types
=
\
core_filetypes
::
get_types
();
// A file with filename '.' is a directory.
$file
=
$this
->
get_stored_file
(
'example content'
,
'example'
,
[
$file
=
$this
->
get_stored_file
(
'example content'
,
'example.docx'
,
[
'mimetype'
=>
$types
[
'docx'
][
'type'
],
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment