Skip to content

Commit 5bae385

Browse files
security update
1 parent fc9242f commit 5bae385

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Module/ContentTextParser.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,19 @@ public static function ParseContentLink($matches, $context) {
5858
// To navigate from the current directory
5959
$contentPath = static::$currentDirectory . '/' . $path;
6060
}
61-
Debug::Log($contentPath);
61+
// Debug::Log($contentPath);
6262
$content = new Content();
6363
if(!$content->SetContent($contentPath)) {
6464
// if not exists, return the text that matched the full pattern.
6565
return $matches[0][0];
6666
}
67+
68+
if(strpos($content->path, static::$currentRootDirectory . '/') !== 0){
69+
// not start with current root directory.
70+
// Debug::Log('Permission denied.');
71+
return $matches[0][0];
72+
}
73+
6774
if(!array_key_exists($content->path, static::$contentLinks)) {
6875
static::$contentLinks[$content->path] = true;
6976
}

0 commit comments

Comments
 (0)