[web-wiki] master: Render only usernames in doodle_template.php

From: Date: Tue, 19 Aug 2025 14:03:01 +0000
Subject: [web-wiki] master: Render only usernames in doodle_template.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-33116@lists.php.net to get a copy of this message
Author: Tim Düsterhus (TimWolla) Committer: Derick Rethans (derickr) Date: 2025-08-19T15:02:58+01:00 Commit: https://github.com/php/web-wiki/commit/3afc81ab78f4e5278bb0c6c4c0d390a1c8d43913 Raw diff: https://github.com/php/web-wiki/commit/3afc81ab78f4e5278bb0c6c4c0d390a1c8d43913.diff Render only usernames in doodle_template.php For all users with a VCS account (which is the vast majority) the real name matches the username and for the others, the username is the more stable and thus more trustworthy value. Changed paths: M dokuwiki/lib/plugins/doodle/doodle_template.php M dokuwiki/lib/plugins/doodle/syntax.php Diff: diff --git a/dokuwiki/lib/plugins/doodle/doodle_template.php b/dokuwiki/lib/plugins/doodle/doodle_template.php index e44b564c..6c7a4595 100755 --- a/dokuwiki/lib/plugins/doodle/doodle_template.php +++ b/dokuwiki/lib/plugins/doodle/doodle_template.php @@ -39,8 +39,8 @@ <?php foreach ($template['doodleData'] as $fullname => $userData) { ?> <tr> <td class="rightalign"> - <?php $fullname = '<a href="//people.php.net/' . $fullname.'">' .$fullname. '</a>';?> - <?php echo (array_key_exists('editLinks', $userData) ? $userData['editLinks'] : '') . $fullname.$userData['username'] ?> + <?php $link = '<a href="https://people.php.net/' . htmlspecialchars($userData['username']) . '">' . htmlspecialchars($userData['username']) . '</a>';?> + <?php echo (array_key_exists('editLinks', $userData) ? $userData['editLinks'] : '') . $link; ?> </td> <?php for ($col = 0; $col < $c; $col++) { echo $userData['choice'][$col]; diff --git a/dokuwiki/lib/plugins/doodle/syntax.php b/dokuwiki/lib/plugins/doodle/syntax.php index f45ab698..44331ef7 100755 --- a/dokuwiki/lib/plugins/doodle/syntax.php +++ b/dokuwiki/lib/plugins/doodle/syntax.php @@ -290,7 +290,7 @@ function render($mode, Doku_Renderer $renderer, $data) { $this->template['count'][$col] = 0; foreach ($this->doodle as $fullname => $userData) { if (!empty($userData['username'])) { - $this->template['doodleData']["$fullname"]['username'] = '&nbsp;('.$userData['username'].')'; + $this->template['doodleData']["$fullname"]['username'] = $userData['username']; } if (in_array($col, $userData['choices'])) { $timeLoc = strftime($conf['dformat'], $userData['time']); // localized time of vote @@ -507,7 +507,7 @@ function getInputTR() { $TR .= '<td class="rightalign">'; if ($fullname) { if ($editMode) $TR .= $this->getLang('edit').':&nbsp;'; - $TR .= $fullname.'&nbsp;('.$_SERVER['REMOTE_USER'].')'; + $TR .= $_SERVER['REMOTE_USER']; $TR .= '<input type="hidden" name="fullname" value="'.$fullname.'">'; } else { $TR .= '<input type="text" name="fullname" value="">';

« previous php.webmaster (#33116) next »