Skip to content

Explicitly give current class for get_class#314

Open
dereckson wants to merge 1 commit into
opensolutions:masterfrom
dereckson:php83-get_class
Open

Explicitly give current class for get_class#314
dereckson wants to merge 1 commit into
opensolutions:masterfrom
dereckson:php83-get_class

Conversation

@dereckson
Copy link
Copy Markdown
Contributor

Calling get_class() without an argument in PHP 8.3+ emits E_DEPRECATED.

Calling get_class() without an argument in PHP 8.3+ emits E_DEPRECATED.
@dereckson dereckson mentioned this pull request Jun 25, 2024
2 tasks
eilandert added a commit to eilandert/ViMbAdmin that referenced this pull request Jun 2, 2026
…eset

Security
- Remove unused OSS framework integrations (library/OSS/API/{DAViCal,SOGo,
  RoundCube,Jabber2d}.php) -- DAViCal contained SQL injection via {$user_id}
  / {$collection_id} interpolated into queries; all four were 0-reference
  dead code.
- ArchiveController: escapeshellarg() every path/name interpolated into the
  tar/bzip2/chown/rm exec() commands (command-injection via mailbox/domain
  names); harden unserialize() with allowed_classes=false.
- OSS/DiskUtils::du(): escapeshellarg() the path instead of escapeshellcmd()
  on the whole command.
- OSS/String::random()/randomFromSet()/randomPassword(): replace the
  insecure str_shuffle()/str_repeat() PRNG with random_int() (CSPRNG).
  These feed remember-me tokens and salts.
- OSS/Resource/Logger: create log files mode 0640, not world-writable 0777.

Dead code
- Delete Doctrine1-era dead code: OSS/Yubico, OSS/Invoice,
  OSS/Auth/DoctrineAdapter (+ its dead switch branch in
  OSS/Controller/Trait/Auth), Smarty function.dynamicContent /
  function.modelOperation; and the unused PDF chain (OSS/Pdf, OSS/Html,
  OSS/Crypt/GibberishAES, PdfGenerator trait).

PHP 8.0+ / 8.5
- Fix every implicit-nullable parameter ($x = null without ?) across
  Entities, Proxies, Twitter/Form, Doctrine2/FirebugProfiler.
- get_class() -> get_class($this) in the four application/plugins
  constructors (upstream PR opensolutions#314).
- error/error.phtml: {get_class($exception)} -> {$exception::class}
  (Smarty 5).

Dependencies / build
- Declare required ext-* in composer.json, set platform php 8.1, enable
  optimize-autoloader. Deps stay on current LTS lines (doctrine/orm 2.20,
  dbal 3, symfony 7, smarty 5).

Upstream fixes folded in
- PR opensolutions#319: rename duplicate IX_Username_1 unique constraint to
  IX_Username_{admin,mailbox} (PostgreSQL schema-create clash).
- PR opensolutions#314: get_class() argument (above).

Snuffleupagus
- New snuffleupagus/vimbadmin-strict.list: code-derived hardening profile,
  validated end-to-end under the FPM SP build (login + ORM read/write +
  exec + drop enforcement, 10/10 pages 200, zero segfaults). Documents the
  build-specific landmines found: no .filename()/.allow()/.pos(0)/
  cookie_encryption (each SIGSEGVs or is unsupported), and that PHP-native
  disable_functions must be empty when SP manages it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant