htmlspecialchars() error

A place for users and developers of the Xataface to discuss and receive support.

Postby ivbo » Wed May 23, 2007 10:51 am

Hello Steve,

I use Dataface v0.7.1 from date of its release. Up to now everything was worked right but today I received surprising error on the end of all result list:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\foss\fas.sfu.ca\dataface-0.7.1\Dataface\ResultList.php on line 302

I changed nothing in application or environment for last 2 weeks (win xp / php 5.2.2 / apache 2.2.4 / mysql 5.).

Do you have some idea where I need to looking for this warning reasons ?


Ivan
ivbo
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed May 23, 2007 11:29 am

Look at the html source for that page to look at the code just before the warning.Ê This error is occurring when it is rendering the selected records form.. evidently there is an array value in the query parameters -- I just want to see what this array.


Thanks for the report.
-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby ivbo » Wed May 23, 2007 12:04 pm

I goes through the html code. There I found a reference to mbfcookie. According to my search it is the array.






Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\foss\fas.sfu.ca\dataface-0.7.1\Dataface\ResultList.php on line 302







When I delete this cookie everything is fine and warning disappeared.


Ivan
ivbo
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby ivbo » Wed May 23, 2007 12:09 pm

I attach HTML Source copy selection:

form id="result_list_selected_items_form" method="post"
input type="hidden" name="PHPSESSID" value="b149bb66724ae4aa7ccea6a27e0dac2d">

Warning: htmlspecialchars() expects parameter 1 to be string, array given in b>C:\foss\fas.sfu.ca\dataface-0.7.1\Dataface\ResultList.php on line 302


input type="hidden" name="mbfcookie" value=""
input type="hidden" name="dataface__lang" value="en"
input type="hidden" name="-table" value="smf_organization"
ivbo
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed May 23, 2007 3:52 pm

On line 299 of ResultList.php, change:

ÊÊÊ ÊÊÊ if ( strlen($key)>1 and $key{0} == '-' and $key{1} == '-' ){

to:
Ê ÊÊÊÊÊ if ( (strlen($key)>1 and $key{0} == '-' and $key{1} == '-') or is_array($val) ){



Another thing I noticed that will be fixed in the next release is on line 302, we have:

urlencode($key)

This should be

htmlspecialchars($key)


Best regards
Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby ivbo » Wed Jun 13, 2007 11:52 am

Hi Steve,

same problem is on the line 474 in Dataface/RelatedList.php file

I used proposed solution for ResultList.php and changed :

if ( strlen($key)>1 and $key{0} == '-' and $key{1} == '-' ){

to :
if ( (strlen($key)>1 and $key{0} == '-' and $key{1} == '-') or is_array($val) ){




Best regards,

Ivan
ivbo
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 4 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved