mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-21 13:00:10 +01:00
Security bug fix.
This commit is contained in:
parent
26b91794ce
commit
e6f09d5ed0
@ -137,7 +137,7 @@ class App {
|
||||
|
||||
$abs_path = $this->get_abs_path($abs_href);
|
||||
|
||||
if (!is_dir($abs_path)) {
|
||||
if (!is_dir($abs_path) || strpos($abs_path, '../') || strpos($abs_path, '/..') || $abs_path == '..') {
|
||||
return 500;
|
||||
}
|
||||
|
||||
@ -170,6 +170,11 @@ class App {
|
||||
|
||||
public function get_items($abs_href, $what) {
|
||||
|
||||
$code = $this->get_http_code($abs_href);
|
||||
if ($code != App::$MAGIC_SEQUENCE) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$cache = array();
|
||||
$folder = Item::get($this, $this->get_abs_path($abs_href), $cache);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user