Project

General

Profile

Actions

Bug #26915

closed

stdWrap.cropHTML does not recognize TYPO3 link attribute correctly (and removes text around)

Added by Jakub Černek almost 13 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2011-05-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Hi,
when the cropHTML try crop text inside TYPO3 link in longer form (e.g. <link - mail "Open email window"></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…


Files

26915.diff (510 Bytes) 26915.diff Fix Jakub Černek, 2011-05-20 01:38

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #30005: stdWrap.cropHTML wrong on full-word crop shortly inside HTML-elementClosed2011-09-19

Actions
Actions #1

Updated by Jakub Černek almost 13 years ago

Probably fixed. Testing and verification needed.
PCRE's sign \w doesn't contain a dash sign '-'. Doublequotes is not a problem.
May be it is a localy dependent.

Actions #2

Updated by Mr. Hudson almost 13 years ago

Patch set 2 of change Id7274fdab0be96a9118341a95dab82386d01c903 has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #3

Updated by Mr. Hudson almost 13 years ago

Patch set 3 of change Id7274fdab0be96a9118341a95dab82386d01c903 has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #4

Updated by Philipp Gampe over 12 years ago

I can not reproduce either. Works fine for me with 5.3.6 (x86_64) on fedora.

Actions #5

Updated by Jakub Černek over 12 years ago

OK, sorry for not proper description how to reproduce it.
My settings:
stdWrap.cropHTML = 82 | ... | 1
and text is not parsed by parsefunc.
Training text:
'Welcome
blah blah blah on email <link - mail "blah blah blah blah blah blah bl"></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 blah blah blah blah"

Actions #6

Updated by Helmut Hummel over 12 years ago

The question is: why do you use "cropHTML" to not actually crop HTML but the pseudo HTML content TYPO3 stores in the database?
To my understanding it's an abuse of that function which should not be "fixed".

Actions #7

Updated by Stefan Neufeind over 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

<div letter-spacing="10px">

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.

Actions #8

Updated by Mr. Hudson over 12 years ago

Patch set 4 of change Id7274fdab0be96a9118341a95dab82386d01c903 has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #9

Updated by Mr. Hudson over 12 years ago

Patch set 5 of change Id7274fdab0be96a9118341a95dab82386d01c903 has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #10

Updated by Oliver Hader over 12 years ago

  • Status changed from New to Under Review
  • Complexity set to medium
Actions #11

Updated by Mr. Hudson over 12 years ago

Patch set 6 of change Id7274fdab0be96a9118341a95dab82386d01c903 has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #12

Updated by Mr. Hudson over 12 years ago

Patch set 7 of change Id7274fdab0be96a9118341a95dab82386d01c903 has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #13

Updated by Chris topher over 12 years ago

  • Subject changed from stdWrap.cropHTML not recognize TYPO3 link attribute correctly (and remove text around) to stdWrap.cropHTML does not recognize TYPO3 link attribute correctly (and removes text around)
Actions #14

Updated by Gerrit Code Review over 12 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #15

Updated by Gerrit Code Review about 12 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #16

Updated by Gerrit Code Review almost 12 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #17

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/10686

Actions #18

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/10687

Actions #19

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/10688

Actions #20

Updated by Gerrit Code Review almost 12 years ago

Patch set 11 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2641

Actions #21

Updated by Gerrit Code Review almost 12 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/10686

Actions #22

Updated by Gerrit Code Review almost 12 years ago

Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/10687

Actions #23

Updated by Gerrit Code Review almost 12 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/10688

Actions #24

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/10690

Actions #25

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/10691

Actions #26

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/10692

Actions #27

Updated by Jakub Černek almost 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 50 to 100
Actions #28

Updated by Gerrit Code Review over 11 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/13121

Actions #29

Updated by Gerrit Code Review over 11 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/13243

Actions #30

Updated by Wouter Wolters over 11 years ago

All branches are updated. Please close this issue.

Actions #31

Updated by Stefan Galinski over 11 years ago

  • Status changed from Under Review to Closed
Actions

Also available in: Atom PDF