mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
BUGFIX: only strip off dot and trailing string if it is a possible extension
This commit is contained in:
parent
160b527dfc
commit
9bd43ae7ad
@ -401,8 +401,13 @@ class DocumentationService {
|
|||||||
|
|
||||||
// if the name has a . then take the substr
|
// if the name has a . then take the substr
|
||||||
$formatted = ($pos = strrpos($formatted, '.')) ? substr($formatted, 0, $pos) : $formatted;
|
$formatted = ($pos = strrpos($formatted, '.')) ? substr($formatted, 0, $pos) : $formatted;
|
||||||
$name = ($dot = strrpos($name, '.')) ? substr($name, 0, $dot) : $name;
|
|
||||||
|
|
||||||
|
if($dot = strrpos($name, '.')) {
|
||||||
|
if(in_array(substr($name, $dot), self::get_valid_extensions())) {
|
||||||
|
$name = substr($name, 0, $dot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// the folder is the one that we are looking for.
|
// the folder is the one that we are looking for.
|
||||||
if(strtolower($name) == strtolower($formatted)) {
|
if(strtolower($name) == strtolower($formatted)) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user