silverstripe-archive / silverstripe-newsletter

NewsletterAdmin is the CMS class for managing the newsletter system.
BSD 3-Clause "New" or "Revised" License
69 stars 59 forks source link

Bug fix - str replacement with forward slash #79

Open jason-zz opened 10 years ago

jason-zz commented 10 years ago

when href="/", value of $link is forward slash symbol. All forward slashes in HTML like

will be replaced with tracking link and layout will be broken. Should search and replace '"/"'.

tractorcow commented 10 years ago

Could this problem also appear elsewhere? Could /about-us and /about-us/staff end up replacing one another?

I suggest a better solution to this is to ensure that the replacement mechanism always replaces quoted strings, rather than just in this one condition.

tractorcow commented 10 years ago

Test cases please :)

jason-zz commented 10 years ago

@tractorcow Yeah that may happen in that case, but I am not sure. I agree that it should replaces quoted string.

A simple test case: add couple paragraphs, insert HomePage (URL segment must be '/') hyperlink, then add some more links.

jason-zz commented 10 years ago

@tractorcow

My debug logs. http://shrib.com/7l5sHpeU