Skip to content

Don't know what's best... - #3

Merged
Spuds merged 25 commits into
SimpleMachines:masterfrom
emanuele45:master
Feb 10, 2012
Merged

Don't know what's best...#3
Spuds merged 25 commits into
SimpleMachines:masterfrom
emanuele45:master

Conversation

@emanuele45

Copy link
Copy Markdown
Contributor

So, let's get rid of these things so we can start fresh... :P

Most likely you don't want this:
emanuele45@d0bc0e6

everything else should already be there and not cause many problems...hopefully.

emanuele and others added 25 commits February 2, 2012 11:58
…ng well with (at least) SQlite, not tested on PostgreSQL
…because comparing values in one array and keys in the other
… with calls to logAction + changed a bit logAction to fully support logs from profile pages
… with calls to logAction + changed a bit logAction to fully support logs from profile pages [Bug 4886]
! removed some micro-optimizations which showed questionable results across various versions of php5 32 & 64bit  (many files)
! removed malformed multi-table deletes (ManageBans.php, ManageMaintenance.php, ManagePermissions.php
! removed some minor changes which would needlessly break mod installations (===)
! prevent undefined index
Spuds added a commit that referenced this pull request Feb 10, 2012
@Spuds
Spuds merged commit d08cb2e into SimpleMachines:master Feb 10, 2012
emanuele45 added a commit that referenced this pull request Sep 23, 2012
@sbulen sbulen mentioned this pull request Jan 1, 2017
Sesquipedalian pushed a commit that referenced this pull request Feb 1, 2024
@sbulen sbulen mentioned this pull request Feb 3, 2025
jdarwood007 pushed a commit that referenced this pull request Aug 2, 2026
fatalLang() takes ($error, $log, $sprintf, $status). Calendar.php puts the
HTTP status where $sprintf goes in all 27 of its calls, and Themes.php hands
that parameter a bare string.

Under strict_types every one of those is a TypeError, so the calendar never
reports a problem it means to report: an invalid month or day, a topic that
is not yours, a missing event title, or the calendar simply being switched
off all end in "Argument #3 ($sprintf) must be of type array" instead of
the message that was written for them. The status codes were the default
403 or plain 400, so nothing is lost by moving them into the slot they
belong in.

Sources/Forum.php, Topic.php and HelpAdmin.php already show the intended
shape: fatalLang('not_found', false, [], 404).

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sesquipedalian pushed a commit that referenced this pull request Aug 14, 2026
ErrorHandlerService::log() json encodes the backtrace before storing it.
The backtraces it collects itself pass DEBUG_BACKTRACE_IGNORE_ARGS, but
that only applies when no backtrace was supplied:

    $backtrace = $backtrace ?? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);

catch() supplies one, from Throwable::getTrace(), and that keeps both the
call arguments and the bound objects. Two consequences:

Anything a member submitted can end up in the error log, including the
password posted to the login form, since it is simply an argument a few
frames down.

Encoding an object reads its properties, which can throw. When it does,
the new error arrives while the first one is still being logged, and an
error that would only have been logged becomes an uncaught fatal that
hides the original. That is what turned a background task failure into a
white page for logged in members:

  Uncaught Error: Cannot access uninitialized non-nullable property
  SMF\User::$username by reference
    #1 Sources/Utils.php(1539): json_encode(Array, 0, 512)
    #2 ErrorHandlerService.php(286): SMF\Utils::jsonEncode(Array)
    #3 ErrorHandlerService.php(185): ...->log('Cannot access u...')

Drops both keys from every frame before encoding. File, line, function
and class are kept, which is what the log is for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
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.

2 participants