Multiple htmlspecialchars() warnings cleaned up. (Bugs)

by DeLorean, Tuesday, March 11, 2014, 14:51 (3691 days ago)

Depending on how a web provider configures PHP, multiple warning messages may show up in a user's display involving htmlspecialchars(). It appears that the original coder of /includes/posting.inc.php issued some calls in the wrong order in lines 411 through 413. When the order was modified slightly, the warning messages were quelled and the code seemed to operate properly. Here's an ed style patch:


#patch posting.inc.php
411,413c
       if(isset($cookie_parts[1])) $smarty->assign('email',htmlspecialchars(urldecode($cookie_parts[1])));
       if(isset($cookie_parts[2])) $smarty->assign('hp',htmlspecialchars(urldecode($cookie_parts[2])));
       if(isset($cookie_parts[3])) $smarty->assign('location',htmlspecialchars(urldecode($cookie_parts[3])));
.


I tried to contact the developers by means of the "contact" link on this board, but have received no response so far. The corrected posting.inc.php file has been made available on the net, and the developers have been told how to reach it if they're interested.

Thanks for My Little Forum, and thanks for considering this suggestion.

Avatar

Confirmed! Multiple htmlspecialchars() warnings cleaned up.

by Auge ⌂, Tuesday, March 11, 2014, 17:20 (3691 days ago) @ DeLorean

Hello

Depending on how a web provider configures PHP, multiple warning messages may show up in a user's display involving htmlspecialchars(). …


#patch posting.inc.php
411,413c
if(isset($cookie_parts[1])) $smarty->assign('email',htmlspecialchars(urldecode($cookie_parts[1])));
if(isset($cookie_parts[2])) $smarty->assign('hp',htmlspecialchars(urldecode($cookie_parts[2])));
if(isset($cookie_parts[3])) $smarty->assign('location',htmlspecialchars(urldecode($cookie_parts[3])));
.

I can confirm the bug. The public available source code shows the wrong nesting (2014-03-11). Thank you for your work.

Attention (for all readers): Until Alex corrects the error in the source code an admin has to patch his installation himself.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

RSS Feed of thread