about summary refs log tree commit diff
path: root/sourcecodes/layout_cyto.php
diff options
context:
space:
mode:
authorClaude Sonnet 52026-08-17 19:09:41 +0000
committerFrederick Muriuki Muriithi2026-08-17 14:52:48 -0500
commit4825da8e49c302392fe6018862dfcdd6f91c6192 (patch)
tree79473d582d4749c75230b0193c2fa5bd502a66cc /sourcecodes/layout_cyto.php
parent55909cd3cadfd070cd157e78ec2364613ed8ab58 (diff)
downloadBNW-4825da8e49c302392fe6018862dfcdd6f91c6192.tar.gz
Guard valid_keyval()/valid_input() against null input (PHP 8.1 deprecation)
These two functions are the single most common entry point in the
codebase — ~30+ files call them as valid_keyval($_GET["My_key"]) or
valid_input($_POST[...]) with no isset() guard at the call site. When
the key is absent, PHP passes null straight into trim(), which is a
non-nullable string parameter. As of PHP 8.1 this triggers a
"Passing null to parameter #1 ($string) ... is deprecated" notice on
every one of those call sites, on every request missing the param.

Coalescing to '' inside the two functions themselves fixes this once,
for every caller, instead of patching every call site individually.

Verified empirically against PHP 8.3.28: valid_keyval(null) /
valid_input(null) no longer emit the trim() deprecation notice and
still return '' as before (same effective behavior as PHP 7.4).

Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
Diffstat (limited to 'sourcecodes/layout_cyto.php')
0 files changed, 0 insertions, 0 deletions