Minor refactorings.

This commit is contained in:
Lars Jung 2012-08-17 22:56:24 +02:00
parent 799f1ecd13
commit 4c96efe1c7
2 changed files with 4 additions and 4 deletions

View File

@ -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'),

View File

@ -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);
}