|
|
@ -34,18 +34,21 @@ class Filesystem |
|
|
|
|
|
|
|
|
|
|
|
public function getPagePathByUri(string $uri): ?string |
|
|
|
public function getPagePathByUri(string $uri): ?string |
|
|
|
{ |
|
|
|
{ |
|
|
|
$uri = urldecode( |
|
|
|
|
|
|
|
$uri |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$path = sprintf( |
|
|
|
$path = sprintf( |
|
|
|
'%s/pages/%s.txt', |
|
|
|
'%s/pages/%s.txt', |
|
|
|
$this->_path, |
|
|
|
$this->_path, |
|
|
|
str_replace( |
|
|
|
str_replace( |
|
|
|
':', |
|
|
|
':', |
|
|
|
'/', |
|
|
|
'/', |
|
|
|
|
|
|
|
trim( |
|
|
|
|
|
|
|
mb_strtolower( |
|
|
|
|
|
|
|
urldecode( |
|
|
|
$uri |
|
|
|
$uri |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
':' |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (!in_array($path, $this->_list) || !is_file($path) || !is_readable($path)) |
|
|
|
if (!in_array($path, $this->_list) || !is_file($path) || !is_readable($path)) |
|
|
|