CAPTCHA Audio Problem With IE

Started by cameronbprince, January 25, 2008, 10:19:04 PM

Previous topic - Next topic

cameronbprince

Hey guys,

This fix resolves the problem with IE only playing the first three letters of the CAPTCHA image.

In Subs-Sound.php, add $context to the global declaration and add the following if statement above the existing header call:

if (empty($context['browser']['is_ie']))
header('Content-Length: ' . $file_size);

IE seems to think the binary data is shorter than it really is. Since IE will play the file fine without the header, this resolves the problem. The header is required for FF and others, so the conditional is the way to go.

Thanks,
Cameron

SleePy

What version of ie is this?

I am able to get it to work in IE7 under xp.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

cameronbprince

The problem occurs on IE6 which is still heavily used. The good thing is, the fix I proposed doesn't break the function on IE7 even though it doesn't have the problem.

SleePy

Reported and for team reference the bug is 1428
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

JayBachatero

#4
I remember reporting this a while back and it being fixed.  I'll look into it and see if it was removed by mistake.  I had the same problem with FF.

EDIT:

I just checked latest SVN and it's there.  What version of SMF are you using?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

SleePy

This was 1.1.4, I didn't check the latest 1.1 svn though.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

JayBachatero

This was fixed before 1.1.4.  It's been there since 1.1 Final.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

SleePy

I still get it in 1.1.4 with IE6.. As well as 2.0 svn
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

JayBachatero

Check the headers that are being sent.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

SleePy

and how do we do that :P I don't use IE much, just have it on my vitrual machine that has xp on it
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Grudge

It is a bug in 1.1.4, I just fixed it.
I'm only a half geek really...

JayBachatero

Umm the header should be sent to all browsers Grudge.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Grudge

Jay, I agree it should be sent to all browsers but IE get's it wrong and cuts short the audio.

If you don't sent it to IE then it simply keeps going until the data stops being sent hence it works.

I'm sure there is a better way but I don't know what that is right now :)
I'm only a half geek really...

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

jrcarr

Quote from: Grudge on February 02, 2008, 08:18:02 AM
It is a bug in 1.1.4, I just fixed it.
That's good to know, but what do I need to change in my existing forum to get it to work right?  Thanks

Jack
Jack Carr

SleePy

The fix provided in the first post will work until the next 1.1 release
Remember to document the change though so when the next 1.1 is released you can reverse this change and have a successful upgrade.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

jrcarr

I'm currently running  1.1.4 and unless I'm not putting the above changes in correctly, it is not solving the problem.

Jack
Jack Carr

SleePy

Then yours may be a different issue if you didn't add the If check to your Subs-Sound.php in 1.1.4
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Grudge

The fix was:

// Output the wav.
header('Content-type: audio/x-wav');
if (empty($context['browser']['is_ie']))
header('Content-Length: ' . $file_size);


I think before it was:

header('Content-type: audio/x-wav');
header('Content-Length: ' . $file_size);
I'm only a half geek really...

jrcarr

That's what I changed, including adding the $context to the global list at the top of the function.  I still only get the first 3 letters from the audio.  Any other suggestions as to something that might be affecting this feature?

Jack
Jack Carr

Advertisement: