Skip to content

Commit e223151

Browse files
committed
Fix undefined index warnings dokufreaks#245
This fixes unpacking too short arrays and adds empty 'hid' values. As we process the data in our own action handler, having empty values here should not cause any side effects.
1 parent a25f142 commit e223151

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

syntax/wrap.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,19 @@ function handle($match, $state, $pos, Doku_Handler $handler) {
3030
*/
3131
function render($mode, Doku_Renderer $renderer, $data) {
3232
if ($mode == 'xhtml') {
33-
list($state, $page, $redirect, $secid) = $data;
33+
$state = array_shift($data);
3434
switch($state) {
3535
case 'open':
36+
list($page, $redirect, $secid) = $data;
3637
if ($redirect) {
3738
if (defined('SEC_EDIT_PATTERN')) { // for DokuWiki Greebo and more recent versions
38-
$renderer->startSectionEdit(0, array('target' => 'plugin_include_start', 'name' => $page));
39+
$renderer->startSectionEdit(0, array('target' => 'plugin_include_start', 'name' => $page, 'hid' => ''));
3940
} else {
4041
$renderer->startSectionEdit(0, 'plugin_include_start', $page);
4142
}
4243
} else {
4344
if (defined('SEC_EDIT_PATTERN')) { // for DokuWiki Greebo and more recent versions
44-
$renderer->startSectionEdit(0, array('target' => 'plugin_include_start_noredirect', 'name' => $page));
45+
$renderer->startSectionEdit(0, array('target' => 'plugin_include_start_noredirect', 'name' => $page, 'hid' => ''));
4546
} else {
4647
$renderer->startSectionEdit(0, 'plugin_include_start_noredirect', $page);
4748
}
@@ -50,7 +51,7 @@ function render($mode, Doku_Renderer $renderer, $data) {
5051
// Start a new section with type != section so headers in the included page
5152
// won't print section edit buttons of the parent page
5253
if (defined('SEC_EDIT_PATTERN')) { // for DokuWiki Greebo and more recent versions
53-
$renderer->startSectionEdit(0, array('target' => 'plugin_include_end', 'name' => $page));
54+
$renderer->startSectionEdit(0, array('target' => 'plugin_include_end', 'name' => $page, 'hid' => ''));
5455
} else {
5556
$renderer->startSectionEdit(0, 'plugin_include_end', $page);
5657
}

0 commit comments

Comments
 (0)