refactor: modernize for PHP 8.x and current DokuWiki#34
Open
teal-bauer wants to merge 1 commit into
Open
Conversation
- Replace legacy class names with namespaced equivalents
(ActionPlugin, AdminPlugin, EventHandler)
- Remove require_once imports (autoloaded)
- Replace raw superglobal access with DokuWiki $INPUT API
- Remove HTML_REGISTERFORM_OUTPUT hook and legacy form code paths
- Replace is_user() file-based lookup with $auth->getUserData() API
- Replace deprecated strftime() with date(), var with typed property
- Add ['allowed_classes' => false] to all unserialize() calls
- Fix XSS: escape hidden input values with hsc() in admin panel
- Fix URL construction: use wl() instead of manual string concat
- Tighten MD5 regex to [a-f0-9]{32}, remove double semicolons
- Remove unused write_debug() method
- Add return types to all methods
- Clean up indentation and trailing whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$_GET/$_POST/$_REQUEST/$_SERVERaccess with DokuWiki's$INPUTAPI, eliminating undefined array key warningsActionPlugin,AdminPlugin,EventHandlerinstead of legacyDokuWiki_Action_Pluginetc.; droprequire_once(autoloaded)HTML_REGISTERFORM_OUTPUThook and old-form code branches ($event->data->_hidden,$event->data->_content), keep onlydokuwiki\Form\Formis_user()file-based plainauth parsing with$auth->getUserData()— works with any auth backendstrftime()→date(),ptln()→echo,var→ typed property['allowed_classes' => false]to allunserialize()callshsc(), build confirmation URLs viawl()instead of manual string concatenation[a-f0-9]{32}, remove unusedwrite_debug(), add return types, fix double semicolonsTechnical Notes
is_user()now uses the auth API, so this works with any auth backend (not just plainauth)wl()generates correct URLs regardless of the wiki's URL rewriting mode