Ticket #8940: 0001-ckeditor-working-with-patched-array-prototype.patch

File 0001-ckeditor-working-with-patched-array-prototype.patch, 1.2 KB (added by pivotal, 3 years ago)

patch to safely iterate over elements in Array

  • public/ckeditor-3.6.3/_source/plugins/filebrowser/plugin.js

    From b387ffc62716cb0d1b6c50b4fbc5b405018d55bc Mon Sep 17 00:00:00 2001
    From: Matthew Kocher & Nate Clark <pair+mkocher+nate@pivotallabs.com>
    Date: Tue, 1 May 2012 17:55:56 -0700
    Subject: [PATCH] ckeditor working with patched array prototype
    
    ---
     .../_source/plugins/filebrowser/plugin.js          |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/public/ckeditor-3.6.3/_source/plugins/filebrowser/plugin.js b/public/ckeditor-3.6.3/_source/plugins/filebrowser/plugin.js
    index d354327..817761f 100755
    a b For licensing, see LICENSE.html or http://ckeditor.com/license 
    242242        {
    243243                var element, fileInput;
    244244
    245                 for ( var i in elements )
     245                for ( var i = 0; i < elements.length; i++ )
    246246                {
    247247                        element = elements[ i ];
    248248
    For licensing, see LICENSE.html or http://ckeditor.com/license 
    399399                var definition = evt.data.definition,
    400400                        element;
    401401                // Associate filebrowser to elements with 'filebrowser' attribute.
    402                 for ( var i in definition.contents )
     402                for ( var i = 0; i < definition.contents.length; i++ )
    403403                {
    404404                        if ( ( element = definition.contents[ i ] ) )
    405405                        {
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy