WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#3890 closed enhancement (wontfix)

Change form on profile page to enctype="multipart-form/data"?

Reported by: benfreefly Owned by:
Milestone: Priority: low
Severity: minor Version: 2.1
Component: Administration Keywords:
Focuses: Cc:

Description

I'm using a profile picture plugin that adds a picture upload section to the profile page. It does not have its own submit button, however, but rather uses the profile_update hook when the entire page is submitted. There is a problem with this however in at least IE7 (unsure about older IE versions) because the form on profile.php does not have the enctype='multipart-form/data' parameter. Firefox seems to recognize that part of the submission contains data without this parameter. Obviously this change can be made easily by those wishing to use this plugin, or similar plugins that might use an <input type=file> tag on the profile page, but requires a WP core edit which most users try to avoid. I offer the change up as a suggestion for future versions of WP.

Change History (7)

comment:1 johnbillion7 years ago

benfreefly, do you have a link to the plugin you're using? I can probably take a look at the plugin source and suggest the necessary change so the plugin itself changes the form encoding type while the plugin is active.

There's no reason really to change every form's encoding just in case some plugin might want to insert an <input type="file"> in there.

comment:2 benfreefly7 years ago

The plugin is here: http://geekgrl.net/2007/01/02/profile-pics-plugin-release/ It already contains javascript intended to dynamically change the form's enctype as part of the onChange event of the <input type="file">, but it seems IE does not allow this parameter to be changed on-the-fly.

comment:3 benfreefly7 years ago

Also, obviously I've mistyped above and the missing parameter should actually read enctype='multipart/form-data'. I had the / and - reversed above.

comment:4 westi7 years ago

  • Milestone changed from 2.3 to 2.2

I don't think we should force the form to multipart. But I would give +1 to a filter on the form encoding type to allow a plugin to modify it.

comment:5 foolswisdom7 years ago

  • Milestone changed from 2.2 to 2.4

comment:6 andersapt7 years ago

Would it be possible to add a similar filter to the encoding type in the user-edit.php file as well?

I've modified the same plugin mentioned above for a client, to also allow the administrator to edit a users profile picture, but to do this, I had to change the encoding type on the user-edit.php page as well.

comment:7 thee176 years ago

  • Milestone 2.5 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This issue can be resolved in the plugin.

Note: See TracTickets for help on using tickets.