Repository navigation
Conversation
This was written for PHP 5. Update anything deprecated in PHP 8.
This worked when we wrote it, but it doesn't work now.
Importing was failing silently, because this object would keep growing. Now we overwrite each parameter each time.
This was returning nothing when a law has no subsections, i.e. is just one chunk of text with no prefixes.
Histories were never being translated because we changed the property name at some point.
Somehow we shipped different CSS and Sass font sizes forever and ever. On this new deploy, building CSS from Sass, the result was that the fonts were way too small. This fixes that.
Per PSR-12.
When ULs were present in sidebars, the right padding was 0, which looked bad, due to the gradient at the edge of the sidebar.
- Replace dangerous extract() calls with explicit variable assignment * class.BaseController.inc.php: Explicit loop instead of extract() in render() * class.LawController.inc.php: Explicit loop instead of extract() in handle() * class.StructureController.inc.php: Explicit loop instead of extract() in handle() * class.MasterController.inc.php: Explicit loop instead of extract() in execute() - Fix incorrect HTTP status code * functions.inc.php: Change 'HTTP/1.0 400 OK' to 'HTTP/1.0 400 Bad Request' - Improve JSONP callback validation * functions.inc.php: Replace regex-based validation with explicit allowlist approach * Add reserved words and built-in globals * Enforce 255 character limit * Validate with proper JavaScript identifier rules These changes prevent: - Variable hijacking through extract() - XSS via JSONP callback bypass - HTTP header confusion attacks Co-authored-by: Copilot App <[email protected]>
Fix variable hijacking, HTTP status code, and JSONP validation
Exports were being generated only when importing a new version of the code. That's probably fine in prod, but testing this, I need to be able to generate exports atomically, and I don't see any harm in having that available in prod.
It is confusing and also wrong to say we're "importing" when we are in fact exporting.
When they're invalid, this kills the entire import, so we check first.
A single error was killing the entire export process, but this will fix that.
They're making predictable trouble.
This shouldn't have been committed in the first place.
This was choking on quotation marks, and we've eliminated the quotation marks, but let's also make it so that it doesn't choke on input like that. Basically, stop treating HTML as well-formed XML.
it's_happening.gif
A list of sections for a given structural unit will, if they're modestly long, wrap at a hyphen. This looks bad. Here we let the column width flex, up to a point, and then let them wrap.
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.
solarium/solariumpackage.extract()calls in the controllers, tightening JSONP callback validation to a strict allowlist, and correcting HTTP status codes.exporttask, so that bulk downloads can be regenerated on demand instead of only as a side effect of importing a new edition of the code.Phew!