extension: don't crash on malformed conflict/dependency idsThe conflicts and depends fields in the repository metadata are freeform text entered by extension authors and may contain values that ar
extension: don't crash on malformed conflict/dependency idsThe conflicts and depends fields in the repository metadata are freeform text entered by extension authors and may contain values that arenot valid extension ids, such as "sprintdoc template". Since 9af82229frouted every Extension construction through the strict setBase()validation, such a value made Extension::createFromId() throw anuncaught RuntimeException while building the notices, taking down thewhole extension manager.Skip entries that cannot be parsed into an extension id when checkingfor missing dependencies and conflicts.As an immeadiate fix this will also be fixed in the repository API toavoid sending invalid extension IDs to the extension manager.Fixes #4691
show more ...
fix(extension): skip invalid directories when listing extensionsA leftover directory whose name is not a valid extension base (e.g."myplugin (copy)") made Extension::setBase() throw, which propaga
fix(extension): skip invalid directories when listing extensionsA leftover directory whose name is not a valid extension base (e.g."myplugin (copy)") made Extension::setBase() throw, which propagatedout of the unguarded getPlugins()/getTemplates() calls and fataled thewhole Extension Manager page and the extension list CLI.Catch the exception per-directory in readExtensionsFromDirectory() so asingle stray directory is skipped and logged instead of breaking everycaller. The throw is kept for the install path.
extension: validate base name to prevent path traversal on installThe extension base name flowed unsanitized from an uploaded archive'splugin.info.txt (or an extension id) into getInstallDir(), wh
extension: validate base name to prevent path traversal on installThe extension base name flowed unsanitized from an uploaded archive'splugin.info.txt (or an extension id) into getInstallDir(), wherefullpath() collapses '..' segments. A crafted base such as'../../../../evil' therefore resolved outside lib/plugins/, lettingdircopy() write the archive contents to an arbitrary web-writable path.Route every base assignment through a new setBase() that rejectsanything other than a bare extension name.Note: this is not really a security concern since plugins can executearbitrary code by design. The is mostly to make sure, plugin code is notinstalled accidentally at the wrong location.
ExtensionManager: get base from plugin classes. fixes #4484When installing a plugin that has no plugin.info.txt, we need to figureout where it belongs from other data. Previously we checked the ar
ExtensionManager: get base from plugin classes. fixes #4484When installing a plugin that has no plugin.info.txt, we need to figureout where it belongs from other data. Previously we checked the archivename or folder within. This will fail for archives generated from githubbranches as the plugin would be named "dokuwiki-plugin-foobar" or "master".This implements looking for known plugin type php files, parsing themwith PHP's parser and extracting the class name. The base name is inthat class name.Seems to work fine in my unit and manual tests.
Extension Manager: adjust testSince we now protect the currently used template, the test needs to beadjusted.
Extension Manager: small language adjustments
Extension Manager: updated tests
First start at refactoring the extension managerThe aim is to readd the existing functionality into proper classes, thenextend from there.
Update extension.test.phpfix for failing test due to aligned url entryref https://github.com/dokuwiki/dokuwiki/issues/4270#issuecomment-2088208289
PSR-2 for extension plugin
update test groups for the extension manager test
added plugins group to test
added tests for the find_folders method
added a first unit test