Errors: Passing null to parameter #1 ($string) of type string is deprecated
Hi!
I'm using Ubuntu 24.04 with PHP 8.3.6. I've installed TCExam without any issues, but I'm encountering some warnings when trying to add a new user. Here are the warnings I'm seeing:
ATTENTION: [8192] htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated | LINE: 408 | FILE: /var/www/html/tcexam/admin/code/tce_functions_user_select.php ATTENTION: [8192] htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated | LINE: 409 | FILE: /var/www/html/tcexam/admin/code/tce_functions_user_select.php ATTENTION: [8192] htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated | LINE: 410 | FILE: /var/www/html/tcexam/admin/code/tce_functions_user_select.php ATTENTION: [8192] htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated | LINE: 411 | FILE: /var/www/html/tcexam/admin/code/tce_functions_user_select.php
I understand that these issues might be related to the PHP version, but I would like to know if there are any potential problems or security concerns with using an updated version of PHP.
Additionally, I would like to know if the TCExam project is still active and if there are plans to update it to support newer versions.
Can anyone help me understand and resolve these warnings?
Thanks in advance! Cheers!
https://phpandmysql.com/updates/passing-null-to-string-functions/ so replace htmlspecialchars($something, ENT_NOQUOTES, $l['a_meta_charset']) to htmlspecialchars($something ?? '', ENT_NOQUOTES, $l['a_meta_charset'])
I had the same issue, solved it by changing the user's level from 0 to another level