mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
filelib MDL-21752 fixed case where mimeinfo_from_icon was including document/unknown when there were better options
This commit is contained in:
parent
e1e613d52c
commit
fda8369f38
@ -1292,6 +1292,9 @@ function mimeinfo_from_icon($element, $icon, $all=false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($all) {
|
if ($all) {
|
||||||
|
if (count($info) > 1) {
|
||||||
|
array_shift($info); // take off document/unknown if we have better options
|
||||||
|
}
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
return array_pop($info); // Return last match (mimicking behaviour/comment inside foreach loop)
|
return array_pop($info); // Return last match (mimicking behaviour/comment inside foreach loop)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user