modxcms/Login

login.php warning : htmlspecialchars() expects parameter 1 to be string, array given

Closed this issue · 5 comments

I keep getting this warning in my logs.
/core/components/login/controllers/web/Login.php : 100) PHP warning: htmlspecialchars() expects parameter 1 to be string, array given

When I look at the login.php file, this is what I can see

98 /* Escape placeholder values */
99 foreach ($phs as $k => $v) {
100 $phs[$k] = htmlspecialchars(str_replace(array('[',']'),array('[',']'),$v)); 
101 }

I am running MODX Revolution 2.5.8-pl, and the login package 1.9.4-pl2

Jako commented

Should be fixed with 1.9.5. Feel free to reopen it, if thats not the case.

I'm still getting this error @Jako.

I'm using Login 1.9.5 and MODX 2.6.1.

I have deleted my cache folder and cleared the cache through the menus.

[2018-02-28 12:49:12] (ERROR @ /paas/123/www/core/components/login/controllers/web/Login.php : 100) PHP warning: htmlspecialchars() expects parameter 1 to be string, array given

thanks @Jako - going to try the commit now and will report back.

Interestingly, the error seems to be triggered when ever a form (any form) is posted.

@Jako that seems to of fixed the error.

For clarity, I had a Login form, plus another form (formit) on the same page. If the formit form triggered validation errors, It would trigger the reported Login error in the MODX error log.