TeamPass icon indicating copy to clipboard operation
TeamPass copied to clipboard

$dataReceived['login'] is null on save

Open jvir opened this issue 2 years ago • 2 comments

Steps to reproduce

  1. Go to one item
  2. Modify item
  3. 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 avatar Dec 13 '23 11:12 jvir

@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) : '';

nilsteampassnet avatar Dec 13 '23 11:12 nilsteampassnet

Closed automatically due to inactivity (no response for over 1 year).

nilsteampassnet avatar Oct 25 '25 12:10 nilsteampassnet