Commit Graph

82 Commits (e0073e0de4ba4ac4b59b82cb054535d1cb6b15a3)

Author SHA1 Message Date
Daniel Supernault e0073e0de4
Fix typos and Lint 3 days ago
Daniel Supernault 5d487afa6c
Lint 3 days ago
Daniel Supernault 823efcaad7
Add FEP-044f: Consent-respecting quote posts 4 days ago
Your Name 53b698ec48 Revert "StrictArrayParamDimFetchRector"
This reverts commit a28d3df4c4.
5 days ago
Your Name a28d3df4c4 StrictArrayParamDimFetchRector 5 days ago
Your Name 0d999f5dda added return type to function 6 days ago
Your Name 5ebc1af91e BATCH 1 6 days ago
Your Name e3b6cebf27 Fix MariaDB driver detection and reblog caption null inserts
Laravel 11 exposes MariaDB as a dedicated 'mariadb' driver, so
config('database.default') === 'mysql' checks silently misclassified
MariaDB as the non-mysql (postgres) branch.

- Add App\Util\Database\DatabaseDriver with isMysqlLike()/isPgsql()
  plus db_is_mysql_like()/db_is_pgsql() global helpers.
- Route all database.default driver checks through the helpers so
  MySQL and MariaDB are treated as one group.
- Use '' (not null) for share/compose caption+rendered, valid whether
  the column is nullable or NOT NULL (it is NOT NULL on MySQL/MariaDB).
- Guard pgsql strtolower() in registration against missing fields.
- Scope CustomEmoji::duplicateShortcodes to the grouped column for
  Postgres GROUP BY validity.
- Remove stale Postgres guard in status:dedup; use havingRaw for
  cross-driver HAVING.
1 week ago
Your Name a424493420 Replace Str::of() fluent chains with static Str::/native calls
Aligns with the app's dominant convention (171 static Str:: calls vs
24 Str::of() chains). Uses Str::afterLast() for the repeated
"segment after last slash" pattern, Str::matchAll() where a
Collection return is needed, and native explode()/substr() where a
plain array/string suffices.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 weeks ago
Your Name 6496904293 Fix account storage limit not freeing on media deletion (#7169)
users.storage_used only ever grew: uploads incremented it but no deletion
path decremented it, so users hit the account size limit even when their
real media usage was well below it.

- Decrement storage_used in MediaDeletePipeline when media is removed
- Add UserStorageService::increaseStorageUsed / decrementStorageUsed as the
  fast, symmetric hot-path counter updates (floor-based, clamped at zero)
- Refactor the 6 upload call sites to use increaseStorageUsed instead of
  duplicated inline writes (also fixes ceil/floor drift vs the reconciler)
- Add (user_id, size) covering index so per-user SUM(size) is not a full
  table scan (INPLACE/LOCK=NONE, skipped on sqlite)
- Add user:storage:recalculate command to repair affected accounts, with a
  daily --stale=168 scheduled reconciler to correct any drift
- Add regression tests for the pipeline and UserStorageService
2 weeks ago
Your Name ec6827bae2 Check media blocklist before storing uploads to prevent orphaned files 2 weeks ago
Your Name e4e12fad7c Extract duplicated blocked-id and duplicate-shortcode query patterns
Two query patterns were copy-pasted across several call sites:

- The 'users who blocked me, plus myself' list used to filter profile
  search (UserFilter::whereFilterableId($pid)->pluck('user_id')->push($pid))
  appeared in ComposeController (x2) and DirectMessageController. Extracted
  to UserFilterService::searchExcludedProfileIds(). Note this is the
  inverse of blocks() (who I blocked), so it is a distinct method.

- CustomEmoji duplicate detection (groupBy('shortcode')->havingRaw(
  'count(*) > 1')) appeared three times in AdminController. Extracted to a
  CustomEmoji::duplicateShortcodes() query scope.

Adds tests for both. No behaviour change.
3 weeks ago
Your Name b52c3d7659 perf: fix N+1 queries; fix ComposeController lint and test namespace
Performance:
- TrendingHashtagService: batch-load hashtags with whereIn/keyBy instead
  of Hashtag::find() per trending row.
- DirectMessageController: eager-load status.media and read the in-memory
  collection instead of firstMedia() issuing a query per DM message.
- GroupsSearchController: batch Profile/Follower/GroupInvitation lookups
  with whereIn instead of per-invitee queries.

Lint/tests:
- ComposeController: whitespace formatting (Pint).
- ComposeControllerTest: correct App\User to App\Models\User, fixing the
  larastan class.notFound error and import ordering.

Full suite: 547 passed. Pint and PHPStan clean.
3 weeks ago
Shlee d9817840c1
Merge pull request #6955 from hohoho1886/location-country-search
Add country filtering to location search
3 weeks ago
Nguyen Ninh Dao 129778ef2e implement search by country 4 weeks ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 54cfdf3c2b refactor: add return type declarations to controller methods
Adds explicit return type declarations to 498 controller methods
across 88 files. Types inferred from return statements:

- JsonResponse for response()->json() returns
- RedirectResponse for redirect()/back() returns
- View (contract) for view() returns
- Response for response() returns
- void for methods with no return value
- array for array returns
- string/int/bool for scalar returns

Also fixes 3 methods with incorrect bare returns:
- AvatarController::deleteAvatar - bare return → json response
- ImportPostController::checkPermissions - bare return → true
- RemoteAuthController::accountToId - bare return → empty array
4 weeks ago
Your Name ffcef3eb2d fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name 1617734907 Revert "Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2"
This reverts commit ce4baf6995, reversing
changes made to 9235cb979a.
4 weeks ago
Your Name 0939f495bb fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Shift 19880c2ffb
Convert string references to `::class`
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
4 weeks ago
Your Name 1a1dc5e096 fix typo 8 months ago
Shlee 133e497879
Larastan: Update ComposeController.php 11 months ago
Daniel Supernault e56bcf3853
Update ComposeController, fix postgres operator 1 year ago
Daniel Supernault 2a9c28b81e
Update ComposeController, fix user tagging endpoint 1 year ago
Daniel Supernault 10eb1a8acb
Update ComposeController, prioritize followed users and follower_count first 1 year ago
Daniel Supernault 56f909a61b
Update ComposeController, add addl compose settings data 1 year ago
Daniel Supernault 1cb01545bc
Update ComposeController, add addl compose settings data 1 year ago
Daniel Supernault 9048ab52c2
Update ComposeController, add addl compose settings data 1 year ago
Daniel Supernault ece23d751b
Update Places, improve cache invalidation/ttl 1 year ago
Daniel Supernault ae47ba73d6
Update ComposeController, fix cache invalidation order 1 year ago
Daniel Supernault 4e938a8ffa
Fix heic, avif, webp support and add libvips driver 1 year ago
Mackenzie Morgan 9966260a91 use case insensitive search when tagging accounts 1 year ago
Daniel Supernault 5f5ed1e62d
Update ComposeController, fix tag mention bug. Closes #5885 1 year ago
Daniel Supernault c36cc07b2c
Update avif support, and fix reply permalinks 2 years ago
Daniel Supernault 17918cbef4
Update ComposeController, add max_media_attachments attribute 2 years ago
Daniel Supernault 85124aa642
Fix rendered caption 2 years ago
Daniel Supernault 1d2f76c8e5
Postgres fixes 2 years ago
Daniel Supernault 9eeb7b6741
Update Status caption logic, stop storing duplicate html caption in db and defer to cached StatusService rendering 2 years ago
Daniel Supernault 424f0271c3
Update ApiV1Controller, fix null caption on media bug 2 years ago
Daniel Supernault a2524910dd
Add migration 2 years ago
Daniel Supernault 665581d80c
Update cloud storage, use config_cache 3 years ago
Daniel Supernault 5e4d4eff9d
Update config cache 3 years ago
Daniel Supernault 62b9eef805
Fix api endpoints 3 years ago
Daniel Supernault 2dcfc81495
Update ComposeController, add parental controls support 3 years ago
Daniel Supernault 75b0f2dda0
Update ComposeController, add permissions check 3 years ago
David Gabriel 2e5c141724 Fix similar SQL error which triggers when mentioning people in new posts 3 years ago
Daniel Supernault 1cc6274ac0
Update rate limits, fixes #4537 3 years ago
Daniel Supernault a91a5e4872
Update StatusEntityLexer, stop saving entities 3 years ago