htmlspecialchars() error on nodeprofile
redtrafik - December 4, 2007 - 14:07
| Project: | Register with Picture |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
Hi and thank you for this module,
I'm trying to install this module and I've got this error on the user/register page :
htmlspecialchars() expects parameter 1 to be string, array given in /home/rafik/test/includes/bootstrap.inc on line 631
Besides, the picture is not uploaded during the registration process.
I'm using nf_registration_mod module with pageroute and node profile modules.
Thank you for your help
Rafik

#1
This happens since both reg_with_pic.module and nodeprofile.module set the value of $form['#attributes']['enctype'], which results in it being an array and thus the error from htmlspecialchars().
I fixed it by wrapping an if() clause around the setting of this value (line 17 in reg_with_pic.module), like this:
if (!module_exists('nodeprofile')) {$form['#attributes']['enctype'] = 'multipart/form-data';
}
I am not attaching a patch cause it will not work in all cases.
It works for me ATM, but I leave it to the author of this module to find the right fix for this.