search: grep contents in repository for 404 suggestions
[minimedit.git] / nieuws.inc.php
index 54853158a6a18ea14514757469d470d9bb4c8f34..35ae0925b87d443ccf1d6e722330599a692abe39 100644 (file)
@@ -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)
@@ -40,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()