Expected string user_string as string, null specified in C: \ xampp ... on line 1662

I recently got this error message on my Wordpress:

Warning: hash_equals (): it is expected that user_string will be the null string given in C: \ xampp3 \ htdocs \ Plurielles \ wordpress \ wp-includes \ pluggable.php on line 1662

Warning: hash_equals (): Expected string user_string as string, null is specified in C: \ xampp3 \ htdocs \ Plurielles \ wordpress \ wp-includes \ pluggable.php on line 1668

It disabled many functions on my site (add an image and much more ....) I looked in the php file for these two lines, and they:

line 1662:

if ( hash_equals( $expected, $nonce ) ) { return 1; } 

line 1668:

 if ( hash_equals( $expected, $nonce ) ) { return 2; } 

Do you know how I could fix this? I am new to PHP, so I apologize if this is really easy to solve (you can throw me rock).

+5
source share
2 answers

Thank you very much for the help I found on the website, I found a solution, and I am posting it here for people who would be in the same situation as me.

You need to use settype ($variable ="string") in my case: settype ($expected ="string") settype ($nonce="string") In wordpress, which should solve the problem.

0
source
 settype ($expected, "string"); settype ($nonce, "string"); 
0
source

Source: https://habr.com/ru/post/1234526/


All Articles