mirror of
https://github.com/YGGverse/gemini-php.git
synced 2026-04-01 17:35:28 +00:00
update getPagePath filter
This commit is contained in:
parent
8378bac08b
commit
85e83f7f49
1 changed files with 8 additions and 5 deletions
|
|
@ -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))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue