Skip to content

fix(config): add null coalescing fallback in getValueBool before strtolower#60654

Open
skjnldsv wants to merge 1 commit into
masterfrom
fix/null-safe-strtolower-getvaluebool
Open

fix(config): add null coalescing fallback in getValueBool before strtolower#60654
skjnldsv wants to merge 1 commit into
masterfrom
fix/null-safe-strtolower-getvaluebool

Conversation

@skjnldsv
Copy link
Copy Markdown
Member

@skjnldsv skjnldsv commented May 22, 2026

Context

Despite having the patch from #59646, a customer is still experiencing the following:

 "url": "/index.php/login",
 "scriptName": "/index.php",
 "message": "strtolower(): Argument #1 ($string) must be of type string, string given in file '/var/www/lajen/lib/private/Config/UserConfig.php' line 688",
 "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0",
 "version": "33.0.3.3",

Summary

Followup to #59646: both AppConfig::getValueBool() and UserConfig::getValueBool() pass the return value of getTypedValue() directly to strtolower(). Although the declared return type is string, the same OPcache/PHP bug that motivated the (string) cast in UserConfig can cause a null to slip through at runtime.

TODO

  • No further changes needed — purely defensive null guard

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes
  • Documentation has been updated or is not required
  • Backports requested where applicable
  • Labels added where applicable (bug, 3. to review)
  • Milestone added for target branch/version

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@skjnldsv skjnldsv requested a review from a team as a code owner May 22, 2026 08:06
@skjnldsv skjnldsv requested review from Altahrim, come-nc, provokateurin and salmart-dev and removed request for a team May 22, 2026 08:06
@skjnldsv skjnldsv force-pushed the fix/null-safe-strtolower-getvaluebool branch from 28fbf8c to 960e92b Compare May 22, 2026 08:08
@skjnldsv skjnldsv self-assigned this May 22, 2026
@skjnldsv skjnldsv added this to the Nextcloud 35 milestone May 22, 2026
@skjnldsv
Copy link
Copy Markdown
Member Author

/backport to stable34

@skjnldsv
Copy link
Copy Markdown
Member Author

/backport to stable33

@skjnldsv
Copy link
Copy Markdown
Member Author

/backport to stable32

@skjnldsv skjnldsv force-pushed the fix/null-safe-strtolower-getvaluebool branch from 960e92b to cea3890 Compare May 22, 2026 08:18
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 22, 2026
…olower

Followup to #59646: guard against null reaching strtolower() in both
AppConfig and UserConfig getValueBool(). Also aligns AppConfig with the
(string) cast added in UserConfig by the original PR.

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/null-safe-strtolower-getvaluebool branch from cea3890 to b86f463 Compare May 22, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish backport-request bug medium regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants