-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
2.3, 2.4
-
None
-
MOODLE_23_STABLE, MOODLE_24_STABLE
In line 71 of file /filter/glossary/yui/autolinker.js there is a looping through an array:
for (key in data.entries) {
|
This is a bad practice for multiple reasons (http://stackoverflow.com/questions/500504/javascript-for-in-with-arrays).
Actually, when using the comercial plugin WIRIS quizzes, the glossary shows 4 popups instead of 1 popup when clicking to the word in question. This is because this plugin has added 3 functions to the array prototype and this way of iterating over the array is iterating in fact over the array object methods and properies.
As we can't assure whether some plugins add methods to the array prototype, we should use the standard way to iterate over the array (which is faster too).
So it would be easily fixed changing this line 71 by:
for (var key = 0; key < data.entries.length; key++) {
|
- has been marked as being related by
-
MDL-53676 Block Navigation Javascript iterates out-of-bounds exception on Array
-
- Closed
-