mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-28 05:54:48 -04:00
Security bug fix.
This commit is contained in:
parent
26b91794ce
commit
e6f09d5ed0
1 changed files with 6 additions and 1 deletions
|
@ -137,7 +137,7 @@ class App {
|
||||||
|
|
||||||
$abs_path = $this->get_abs_path($abs_href);
|
$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;
|
return 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,6 +170,11 @@ class App {
|
||||||
|
|
||||||
public function get_items($abs_href, $what) {
|
public function get_items($abs_href, $what) {
|
||||||
|
|
||||||
|
$code = $this->get_http_code($abs_href);
|
||||||
|
if ($code != App::$MAGIC_SEQUENCE) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
$cache = array();
|
$cache = array();
|
||||||
$folder = Item::get($this, $this->get_abs_path($abs_href), $cache);
|
$folder = Item::get($this, $this->get_abs_path($abs_href), $cache);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue