X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/15a408fca4266bcfd04289cb2d21af5057120035..ed38c6a76767a893a319f7bfd9229b0dad6b08db:/article.inc.php diff --git a/article.inc.php b/article.inc.php index da18368..d8ddf77 100644 --- a/article.inc.php +++ b/article.inc.php @@ -50,6 +50,30 @@ class ArchiveArticle return $this->$col = $this->$col(); # run method and cache } + function handler() + { + $path = $this->link; + $this->path = ''; + $this->restricted = FALSE; + while (TRUE) { + if (file_exists("$path/.private")) { + $this->restricted = $path; + } + + if (file_exists("$path/index.php")) { + return $path; + } + + $up = strrpos($path, '/'); + $this->path = substr($path, $up) . $this->path; + $path = substr($path, 0, $up); + if ($up === FALSE) { + break; + } + } + return; + } + function safetitle() { return trim($this->meta['og:title'] ?? strip_tags($this->title));