Skip to content

Commit 408dc3c

Browse files
committed
Fix checks in 'doodle2' plugin
1 parent 19c0cfa commit 408dc3c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dokuwiki/lib/plugins/doodle/doodle_template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<tr>
4141
<td class="rightalign">
4242
<?php $fullname = '<a href="//people.php.net/' . $fullname.'">' .$fullname. '</a>';?>
43-
<?php echo $userData['editLinks'].$fullname.$userData['username'] ?>
43+
<?php echo (array_key_exists('editLinks', $userData) ? $userData['editLinks'] : '') . $fullname.$userData['username'] ?>
4444
</td>
4545
<?php for ($col = 0; $col < $c; $col++) {
4646
echo $userData['choice'][$col];

dokuwiki/lib/plugins/doodle/syntax.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ function render($mode, Doku_Renderer $renderer, $data) {
223223
//FIXME: count($choices) may be different from number of choices in $doodle data!
224224

225225
$can_vote = false;
226-
if ($INFO["userinfo"] && count(array_intersect(array('admin', 'phpcvs', 'voting'), $INFO['userinfo']['grps'])) > 0) {
226+
if (array_key_exists("userinfo", $INFO) && $INFO["userinfo"] && count(array_intersect(array('admin', 'phpcvs', 'voting'), $INFO['userinfo']['grps'])) > 0) {
227227
$can_vote = true;
228228
}
229229
// ----- FORM ACTIONS (only allowed when showing the most recent version of the page, not when editing) -----
230230
$formId = 'doodle__form__'.cleanID($this->params['title']);
231-
if ($ACT == 'show' && $_REQUEST['formId'] == $formId && $REV == false && $can_vote) {
231+
if ($ACT == 'show' && array_key_exists('formId', $_REQUEST) && $_REQUEST['formId'] == $formId && $REV == false && $can_vote) {
232232
// ---- cast new vote
233233
if (!empty($_REQUEST['cast__vote'])) {
234234
$this->castVote();
@@ -567,7 +567,7 @@ function readDoodleDataFromFile() {
567567
}
568568
}
569569

570-
if (strcmp($this->params['sort'], 'time') == 0) {
570+
if (array_key_exists('sort', $this->params) && strcmp($this->params['sort'], 'time') == 0) {
571571
debout("sorting by time");
572572
uasort($doodle, 'cmpEntryByTime');
573573
} else {

0 commit comments

Comments
 (0)