Infinite loop in transform.py

Bug #395007 reported by Tim Godfrey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Singing & Dancing
New
Undecided
Unassigned

Bug Description

When some links are set up in FCKEditor, they are entered in the form of "http://plone.org/../../../../../../../../../www.abc.com"

Although clearly wrong, this causes singing & dancing to go into an infinite loop if you try and put one of these links into a newsletter using the "Send as Newsletter" action.

The code where it happens is at line 77 of collective/dancing/transform.py

                while '..' in parts:
                    dots = parts.index('..')
                    del parts[dots]

I propose to change it to

                while '..' in parts:
                    dots = parts.index('..')
                    del parts[dots]

                    if dots > 0:
                        del parts[dots - 1]

To avoid the infinite loop state.

Would you consider including this in the next release?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.