Don't know what's best... - #3
Merged
Merged
Conversation
… th, closing tag td)
…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
… report and th fix
Closed
This was referenced Aug 2, 2020
Closed
Closed
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>
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.
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.