page: store placeholder values in $Page object
[minimedit.git] / widget / login / commits.php
index b86b6c5f8d76f2034fe722070916efd047290f47..72f897eee197cfce2bad6c5fbe549991e66251e2 100644 (file)
@@ -4,7 +4,7 @@ if (!function_exists('popen')) {
        return;
 }
 
-$pagesize = intval(@$Place['n'] ?: @$_GET['n']) ?: 20;
+$pagesize = intval(@$Page->place['n'] ?: @$_GET['n']) ?: 20;
 $gitcmd = "git log -n $pagesize --pretty='%at\t%an\t%s'";
 
 if ( $offset = intval(@$_GET['start']) ) {
@@ -18,14 +18,15 @@ if ( $log = popen($gitcmd, 'r') ) {
                list ($atime, $author, $message) = explode("\t", $line, 3);
                list ($author) = explode(' ', $author); # first name only
                printf('<li>%s <small class="date">%s • %s</small></li>'."\n",
-                       $message, $author, strftime('%F %H:%M', $atime)
+                       htmlspecialchars($message),
+                       htmlspecialchars($author), strftime('%F %H:%M', $atime)
                );
                $lines++;
        }
        print "</ul>\n\n";
        pclose($log);
 
-       $navbase = $Page == 'login/commits' ? '?' : '/login/commits?';
+       $navbase = $Page->handler == 'login/commits' ? '?' : '/login/commits?';
        $nav = [];
        $nav[] = sprintf('Pagina %d', ceil($offset / $pagesize) + 1);
        if ($lines >= $pagesize) {