glensc / dokuwiki-plugin-pageredirect

Redirects page requests based on content
https://www.dokuwiki.org/plugin:pageredirect
19 stars 19 forks source link

Update action.php to fix warning (issue #44). #45

Closed nerun closed 5 months ago

nerun commented 1 year ago
PHP Warning:  Undefined array key 1 in /home/domain/public_html/lib/plugins/pageredirect/action.php on line 74

In action.php, line 74, I have changed:

list($page, $section) = explode('#', $page, 2);

to

list($page, $section) = array_pad(explode('#', $page, 2), 2, null);

It works, redirect works fine, and error.log disappears.

About PHP array_pad.

nerun commented 1 year ago

@glensc could you analyze this PR?

glensc commented 5 months ago

merged with https://github.com/glensc/dokuwiki-plugin-pageredirect/pull/47