tcexam icon indicating copy to clipboard operation
tcexam copied to clipboard

Errors: Passing null to parameter #1 ($string) of type string is deprecated

Open rocnateb opened this issue 1 year ago • 2 comments

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!

rocnateb avatar Jul 29 '24 12:07 rocnateb

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'])

IdenticalParticle avatar Feb 12 '25 12:02 IdenticalParticle

I had the same issue, solved it by changing the user's level from 0 to another level

royken avatar Mar 20 '25 10:03 royken