2.0.7 Javascript error in editor with Opera

Started by caribe1999, February 04, 2014, 06:43:16 PM

Previous topic - Next topic

caribe1999

I found a javascript bug in /Themes/scripts/script.js with Opera. The involved line is:

var goForward = is_opera ? text1.match(/\n/g).length : 0, goForwardAll = is_opera ? (text1 + text2).match(/\n/g).length : 0;

This line worked fine before my last update because it was a little different:

var ma, goForward = is_opera && (ma = text1.match(/\n/g)) ? ma.length : 0, goForwardAll = is_opera && (ma = (text1 + text2).match(/\n/g)) ? ma.length : 0;

I don't know why this was changed, but the match method returns null when nothing is found and so calling the length property rises an error.

I recently updated to 2.0.7 using the upgrade tarball and not, as usual, with the package manager, so I don't know if the bug appeared in this release or in a previous one.

Arantor

No patch from 2.0.0 to 2.0.7 modifies script.js as can be verified via http://custom.simplemachines.org/upgrades/

That suggests a mod you added has changed it.

Advertisement: