Skip to content

Commit 579c11e

Browse files
authored
Fix PHP Warning
`PHP message: PHP Warning: Undefined array key 1 in /dokuwiki-test/lib/plugins/blog/syntax/blog.php on line 28`
1 parent 5ba2e03 commit 579c11e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

syntax/blog.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ function handle($match, $state, $pos, Doku_Handler $handler) {
2222
global $ID;
2323

2424
$match = substr($match, 7, -2); // strip {{blog> from start and }} from end
25-
list($match, $flags) = explode('&', $match, 2);
25+
list($match, $flags) = array_pad(explode('&', $match, 2), 2, null);
2626
$flags = explode('&', $flags);
2727
array_unshift($flags, 'link'); // always make the first header of a blog entry a permalink (unless nolink is set)
28-
list($match, $refine) = explode(' ', $match, 2);
29-
list($ns, $num) = explode('?', $match, 2);
28+
list($match, $refine) = array_pad(explode(' ', $match, 2), 2, null);
29+
list($ns, $num) = array_pad(explode('?', $match, 2), 2, null);
3030

3131
if (!is_numeric($num)) {
3232
if (is_numeric($ns)) {

0 commit comments

Comments
 (0)