glensc / dokuwiki-plugin-pageredirect

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

Undefined array key action.php line 74 (with FIX) #44

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
nerun commented 1 year ago

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 #45 ?

Miro-Collas commented 11 months ago

Had the same problem here, applied your suggested fixes. Seems to work. Thank you!

glensc commented 5 months ago

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