Closed (fixed)
Project:
Hide submit button
Version:
6.x-1.9
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
5 Dec 2009 at 04:02 UTC
Updated:
7 May 2010 at 09:00 UTC
The button replacement code contains '<" and "/" in a string which causes a validation warning. I don't think it should but there is a simple fix using PHP to raw_url_encode the message and then have JavaScript escape it.
hide_submit.module line 301
$operation = (variable_get('hide_submit_script_mode', HIDE_SUBMIT_MODE_HIDE) == HIDE_SUBMIT_MODE_HIDE)
? "$(this).siblings('input:submit').hide(); $(this).hide(); $('$message').insertAfter(this); "
: "$(this).siblings('input:submit').attr('disabled', true); $(this).attr('disabled', true);";
Changed to
$message = rawurlencode($message);
$operation = (variable_get('hide_submit_script_mode', HIDE_SUBMIT_MODE_HIDE) == HIDE_SUBMIT_MODE_HIDE)
? "$(this).siblings('input:submit').hide(); $(this).hide(); $(unescape('$message')).insertAfter(this); "
: "$(this).siblings('input:submit').attr('disabled', true); $(this).attr('disabled', true);";
This is tested and working on my site.
Comments
Comment #1
optalgin commentedThanks,
I'll commit this soon
Comment #2
optalgin commentedI moved the script to .js file - instead of ugly script generation
This should fix this issue as well
Please check the latest 6.x-1.x-dev release
New package should be ready soon (verify date - jan-2010)
Comment #3
optalgin commented