Repository navigation
Unblock removes .htaccess lines right away; fix multi-unblock, allow list sorting, duration labels - #31
Merged
Conversation
…rst lifted one - With blocking through .htaccess, unblocking in the block list or with an emailed unblock link only recorded the unblock in the database; the web server kept rejecting the address until the plugin blocked the next one or ran its daily maintenance (up to a day). Both now remove what was lifted from .htaccess right away (HtaccessHelper::removeLiftedBlocks() of the plugin branch of the same name). - UnblockHelper::unblockDB() returned at the first selected block which was unblocked already, so the blocks selected after it stayed blocked and the list reported a failure. It goes on with the others now. - A database exception while inserting an unblock left the result at "success"; it is a failure now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFJFMPv7CSqgJJ93QJvYfL
The column headers sorted by b.id, b.ipaddress and b.notes, which are not among AllowlistModel's filter fields (the table alias is "a"), so ListModel replaced them by the default ordering and clicking a header did nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFJFMPv7CSqgJJ93QJvYfL
convertDurationToReadable() built a language key from the duration, which only exists for the durations of the block form. The plugin's settings also offer a week and 30 days, and the progressive block duration doubles the duration up to 64 times, so such blocks showed e.g. COM_BFSTOP_BLOCK_168HOURS. DurationHelper keeps the existing strings and shows any other duration as a number of days, hours or minutes (new strings COM_BFSTOP_BLOCK_N_DAYS/HOURS/MINUTES, in all languages). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFJFMPv7CSqgJJ93QJvYfL
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.
Component half of a bug/security review of plugin and component. The plugin PR is the bfstop branch of the same name (
ccr-f557f83f-uk6a4f). Its tests cover these changes, and this branch needsHtaccessHelper::removeLiftedBlocks()from it.Changes
.htaccessright away (776cf14). With blocking through .htaccess, unblocking in the block list or with the emailed unblock link only recorded the unblock in the database. The web server kept rejecting the address until the plugin blocked the next one or ran its daily maintenance, which could be up to a day.BlocklistModel::unblock()andTokenunblockModelnow callUnblockHelper::removeLiftedHtaccessBlocks(). Lines an admin added by hand, with no block in the database, are left alone, as before.776cf14).UnblockHelper::unblockDB()returnedfalseat the first such block, so the blocks selected after it stayed blocked. Also, a database exception during the insert left the result at "success".29203dc). The headers sorted byb.id,b.ipaddressandb.notes, but the model's filter fields and table alias usea.*, soListModelfell back to the default ordering and clicking a header did nothing.aa79c35).convertDurationToReadable()built a language key from the duration, and those keys only exist for the durations in the block form. Blocks of a week or 30 days (both offered in the settings) and progressive durations showed raw keys likeCOM_BFSTOP_BLOCK_168HOURS. The newDurationHelperkeeps the existing strings and shows any other duration as days, hours or minutes, using newCOM_BFSTOP_BLOCK_N_DAYS/HOURS/MINUTESstrings in all 10 languages.None of this affects the released 1.5.x: removing lifted blocks from .htaccess and progressive durations are both new in 2.0.0. The sorting bug may be older.
Testing
Run locally against Joomla 5.4.10 on PostgreSQL 16, with plugin and component installed from these branches (
tests/ci/install-joomla.sh):mainof this repo and pass on this branch.check-language.php bfstop.xml COM_BFSTOP: 0 errors, 0 warnings.check-zip,php -land xmllint all pass.Generated by Claude Code