Skip to content

Commit

Permalink
Fix a number of PHP Warnings
Browse files Browse the repository at this point in the history
```
PHP message: PHP Warning:  Undefined array key 1 in /dokuwiki-test/lib/plugins/blog/syntax/blog.php on line 28
PHP message: PHP Warning:  Undefined array key "first" in /dokuwiki-test/lib/plugins/blog/syntax/blog.php on line 51
PHP message: PHP Warning:  Undefined array key "blog:testing_the_blog_plugin" in /dokuwiki-test/lib/plugins/blog/syntax/blog.php on line 126
PHP message: PHP Warning:  Undefined array key "blog:testing_the_blog_plugin" in /dokuwiki-test/lib/plugins/blog/syntax/blog.php on line 128
```
  • Loading branch information
fiwswe committed Sep 8, 2022
1 parent 579c11e commit e1ad462
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions syntax/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ function handle($match, $state, $pos, Doku_Handler $handler) {
}

function render($mode, Doku_Renderer $renderer, $data) {
global $INPUT;

list($ns, $num, $flags, $refine) = $data;

$first = $_REQUEST['first'];
$first = $INPUT->int('first');
if (!is_numeric($first)) $first = 0;

// get the blog entries for our namespace
Expand Down Expand Up @@ -121,9 +123,9 @@ function render($mode, Doku_Renderer $renderer, $data) {
// now include the blog entries
foreach ($entries as $entry) {
if ($mode == 'xhtml' || $mode == 'code') {
if(auth_quickaclcheck($entry['id']) >= AUTH_READ) {
if(isset($entry['id']) && (auth_quickaclcheck($entry['id']) >= AUTH_READ)) {
// prevent blog include loops
if(!$this->included_pages[$entry['id']]) {
if(!array_key_exists($entry['id'], $this->included_pages) || !$this->included_pages[$entry['id']]) {
$this->included_pages[$entry['id']] = true;
$renderer->nest($include->_get_instructions($entry['id'], '', 'page', $clevel, $include_flags));
$this->included_pages[$entry['id']] = false;
Expand Down

0 comments on commit e1ad462

Please sign in to comment.