X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/e23ce7dc52392f928bf5879605da57e4bf7a7823..fa30f71a6ab727c90e0b600582f9944dfaa1ca89:/nieuws.inc.php diff --git a/nieuws.inc.php b/nieuws.inc.php index 930eb00..35ae092 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -19,7 +19,7 @@ class ArchiveArticle function __construct($path) { $this->page = $path; - $this->link = preg_replace('/\.html$/', '', $path); + $this->link = preg_replace('{(?:/index)?\.html$}', '', $path); } function __get($col) @@ -29,6 +29,7 @@ class ArchiveArticle function file() { + if (!file_exists($this->page)) return; return fopen($this->page, 'r'); } @@ -39,7 +40,12 @@ class ArchiveArticle function safetitle() { - return strip_tags($this->title); + return trim(strip_tags($this->title)); + } + + function name() + { + return $this->safetitle ?: $this->link; } function last()