TeamPass
TeamPass copied to clipboard
$dataReceived['login'] is null on save
Steps to reproduce
- Go to one item
- Modify item
- App return error 500
Expected behaviour
Save item with new info
Actual behaviour
-
App return error 500,
-
In the logs you see an error "PHP Fatal error: Uncaught TypeError: htmlspecialchars_decode(): Argument #1 must be of type string, null given in /var/www/tp/sources.items.queries.php:867"
Server configuration
PHP version: 8.2
Teampass version: 3.10.0
Updated from an older Teampass or fresh install:
Updated from 3.0.9
PLEASE attach to this issue the file /includes/config/tp.config.php.
:**
@jvir
In file sources/items.queries.php, please do the next
Find
$post_password = $original_pw = htmlspecialchars_decode($dataReceived['pw']);
$post_login = filter_var(htmlspecialchars_decode($dataReceived['login']), FILTER_SANITIZE_FULL_SPECIAL_CHARS);
and replace by
$post_password = $original_pw = isset($dataReceived['pw']) && is_string($dataReceived['pw']) ? htmlspecialchars_decode($dataReceived['pw']) : '';
$post_login = isset($dataReceived['login']) && is_string($dataReceived['login']) ? filter_var(htmlspecialchars_decode($dataReceived['login']), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '';
Closed automatically due to inactivity (no response for over 1 year).