nieuws: consistent url input to article parser
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 31 Jul 2018 21:39:26 +0000 (23:39 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 31 Jul 2018 21:41:37 +0000 (23:41 +0200)
Should be valid even if currently unused.

nieuws.inc.php
nieuws/index.php

index 8af5694a62dfb5e2c12987d57561e8921c9891a5..3f3f16391f6bf6c0bc8cc5276b558a697dbf6abc 100644 (file)
@@ -25,7 +25,7 @@ function shownewsarticle($url, $link = TRUE, $title = NULL)
        $title = sprintf(
                $link ? '<h3><a href="/%2$s">%s</a></h3>' : '<h2>%s</h2>',
                getoutput([1 => ' <small class="date">'.$date.'</small>']),
-               preg_replace('/\.html$/', '', $url)
+               $url
        );
        return preg_replace('{<h2>(.*?)</h2>}', $title, $html);
 }
@@ -37,7 +37,7 @@ function shownews($input, $limit = 1000)
                print "<article>";
                ob_start();
                include $url;
-               print shownewsarticle($url);
+               print shownewsarticle(preg_replace('/\.html$/', '', $url));
                print "</article>\n\n";
 
                if (--$limit <= 0) break;
index 51cab26931bb9823c603fdae0f57756effa5e36a..d6a85e7f36d88c62e0291505fcde2dac18e6d7e8 100644 (file)
@@ -5,7 +5,7 @@ include 'nieuws.inc.php';
 
 if ($page and !is_numeric($page)) {
        $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
-       print shownewsarticle($Args, FALSE, $edit);
+       print shownewsarticle($Page.$Args, FALSE, $edit);
        return 1;
 }