Skip to content

Two fixes and one minor feature - #2

Merged
Spuds merged 8 commits into
SimpleMachines:masterfrom
emanuele45:master
Feb 2, 2012
Merged

Two fixes and one minor feature#2
Spuds merged 8 commits into
SimpleMachines:masterfrom
emanuele45:master

Conversation

@emanuele45

Copy link
Copy Markdown
Contributor

Bug: 0004823: search error string prints %1$d (http://dev.simplemachines.org/mantis/view.php?id=4823)
And mod http://custom.simplemachines.org/mods/index.php?mod=3120
Bug: 0004826: postgreSQL and SQLite types replacement (http://dev.simplemachines.org/mantis/view.php?id=4826)

Spuds added a commit that referenced this pull request Feb 2, 2012
Two fixes and one minor feature
@Spuds
Spuds merged commit 87f1d1e into SimpleMachines:master Feb 2, 2012
emanuele45 pushed a commit that referenced this pull request Jul 2, 2012
Need to get the hang of using branches, I keep forgetting to make sure I'm changing the right one...
emanuele45 added a commit that referenced this pull request Sep 23, 2012
little wrong variable :)
emanuele45 pushed a commit that referenced this pull request Jan 8, 2013
Oldiesmann pushed a commit that referenced this pull request Apr 21, 2014
Dragooon pushed a commit that referenced this pull request Jun 22, 2014
SQL Query not needed for guests since they can not be a group moderator
MissAllSunday added a commit that referenced this pull request Nov 11, 2015
[WIP] Some improvements from me
@sbulen sbulen mentioned this pull request Jan 1, 2017
@sbulen sbulen mentioned this pull request Oct 15, 2017
@illori illori mentioned this pull request Jun 29, 2018
jdarwood007 pushed a commit that referenced this pull request Jan 19, 2024
This was referenced Feb 3, 2025
jdarwood007 pushed a commit that referenced this pull request Aug 8, 2026
browse() reads the emulation version list out of admin_info_files, where the copy
fetched from simplemachines.org is cached, and hands it straight to preg_replace()
and then in_array(). A forum that has never managed to fetch it has an empty row,
jsonDecode() returns null, preg_replace() gives back null rather than an array,
and the page dies:

    in_array(): Argument #2 ($haystack) must be of type array, string given

That is the state of every fresh install until the first successful fetch, and the
permanent state of any forum without outbound access. Falls back to an empty list,
which the line below already handles by adding the current version to it.

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>
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Sep 6, 2026
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.

3 participants