Page 1 of 1
Posted:
Wed May 23, 2007 10:51 am
by ivbo
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
Posted:
Wed May 23, 2007 11:29 am
by shannah
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
Posted:
Wed May 23, 2007 12:04 pm
by ivbo
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
Posted:
Wed May 23, 2007 12:09 pm
by ivbo
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"
Posted:
Wed May 23, 2007 3:52 pm
by shannah
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
Posted:
Wed Jun 13, 2007 11:52 am
by ivbo
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