stdWrap.cropHTML does not recognize TYPO3 link attribute correctly (and removes text around)
when the cropHTML try crop text inside TYPO3 link in longer form (e.g. <link email@example.com - mail "Open email window">firstname.lastname@example.org</link>), then all paragraph (or other tag with content) around this link is removed.
It can lead to remove all content.
Responsible is RegExp on line 4323 in typo3_src-4.4.7/typo3/sysext/cms/tslib/class.tslib_content.php
It doesn't handle dash and doublequote signs…
Updated by Jakub Černek over 12 years ago
OK, sorry for not proper description how to reproduce it.
stdWrap.cropHTML = 82 | ... | 1
and text is not parsed by parsefunc.
blah blah blah on email <link email@example.com - mail "blah blah blah blah blah blah bl">firstname.lastname@example.org</link> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah'
Without fix it make "Welcome"
Proper break is somewhere "Welcomeblah blah blah on email email@example.com blah blah blah blah"
Updated by Stefan Neufeind about 12 years ago
Helmut, while in general I agree with you that it's not really "normal" HTML-content (and maybe not "the right weapon" to choose) I don't see why cropHTML needs to be overly restrictive. There might be a character like this minus in the string - but no browser or whatever would have a problem with that I expect since it would first search for the closing tag and be done with the general parsing. What the function currently does is fail "somewhere" in the middle of a tag which imho is "fully broken".
The word-characters (\w in this PCRE) don't include the minus-sign. But even if you say this pseudo-HTML is "artificial" and not really html, what if tomorrow somebody throws something like
at it. Okay, that's not valid HTML and he/she made an error not to use the correct style-tag for it. But why should the crop-functionality fail on this one?
That having said: I'd favor for the function to be more open about "unexpected" characters and try to solve the job as easy as possible trying to find the closing tag and be done.