mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-19 12:00:01 +01:00
Minor refactorings.
This commit is contained in:
parent
799f1ecd13
commit
4c96efe1c7
@ -6,7 +6,7 @@ var path = require('path'),
|
||||
child_process = require('child_process');
|
||||
|
||||
|
||||
var version = '0.22-dev-8',
|
||||
var version = '0.22-dev-11',
|
||||
|
||||
root = path.resolve(__dirname),
|
||||
src = path.join(root, 'src'),
|
||||
|
@ -8,7 +8,7 @@ class Entry {
|
||||
private static $cache = array();
|
||||
|
||||
|
||||
private static function startsWith($sequence, $part) {
|
||||
private static function starts_with($sequence, $part) {
|
||||
|
||||
return (substr($sequence, 0, strlen($part)) === $part);
|
||||
}
|
||||
@ -22,7 +22,7 @@ class Entry {
|
||||
|
||||
public static function get($h5ai, $absPath, $absHref) {
|
||||
|
||||
if (!Entry::startsWith($absHref, $h5ai->getRootAbsHref())) {
|
||||
if (!Entry::starts_with($absHref, $h5ai->getRootAbsHref())) {
|
||||
error_log("ILLEGAL REQUEST: " . $absHref . ", " . $absPath . ", " . $h5ai->getRootAbsHref());
|
||||
return null;
|
||||
}
|
||||
@ -75,7 +75,7 @@ class Entry {
|
||||
|
||||
$this->parent = null;
|
||||
$parentAbsHref = H5ai::normalize_path(dirname($this->absHref), true);
|
||||
if ($this->absHref !== "/" && Entry::startsWith($parentAbsHref, $h5ai->getRootAbsHref())) {
|
||||
if ($this->absHref !== "/" && Entry::starts_with($parentAbsHref, $h5ai->getRootAbsHref())) {
|
||||
$this->parent = Entry::get($this->h5ai, H5ai::normalize_path(dirname($this->absPath)), $parentAbsHref);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user