Repository navigation
HD storage: honour the unlimited quota and reuse cached files; escape SVG output - #214
Merged
Merged
Conversation
- max_storage_mb = 0 now means no quota (as the config documents): no size cleanup, 0% usage in statistics, no division by zero. - getCachedUrl() looks up and writes one stable, content-addressed file name instead of a timestamped one it could never find. - The URL cache key includes colours, shape, font, border and the storage disk/directory; the toBase64 key includes colours, font family and border radius. - toSvg() escapes initials and attribute values (ENT_XML1|ENT_QUOTES). - HDAvatar imports the Storage facade it uses in createSpriteSheet(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ZbncuXneGAhsgTaizfjVi
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.
Fixes in the HD storage layer and the SVG builder. No public method signatures change.
HD storage
max_storage_mb = 0now means no quota, asconfig/config-hd.phpdocuments:checkStorageLimits()andcleanupLargeFiles()skip cleanup, andgetStorageStatistics()reports0.0usage instead of dividing by zero.getCachedUrl()applies the responsive size first, then uses one stable, content-addressed path ({hash}_{size}.{format}) for both the lookup and the write. Before, the lookup name included the size and a timestamp, so it never matched whatexport()wrote.export()keeps its existing naming.generateCacheKey()(URL cache) includes colours, shape, font, border and the storage disk/directory.cacheKey()(base64 cache) includes colours, font family and border radius.HDAvatarimports theStoragefacade used bycreateSpriteSheet().SVG
toSvg()escapes the initials and the colour/font-family attribute values withhtmlspecialchars(ENT_XML1 | ENT_QUOTES). The existing entity test now expects&.Tests (all fail on
master, pass here): quotes in SVG attributes,&in initials, zero quota means unlimited, URL cache key inputs,getCachedUrl()reuses its file.Checked locally:
vendor/bin/phpunitwith--prefer-stableand--prefer-lowest(113 tests OK, same skips as master).🤖 Generated with Claude Code
https://claude.ai/code/session_016ZbncuXneGAhsgTaizfjVi