Feature #22338

Added marker in CONTENT object

Added by Jigal van Hemert about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-03-29
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

By using markers and properly quoting and escaping the values any value can be used in the properties of 'select'.
- a 'markers' property is add where the values of the markers (each with stdWrap support) can defined
- the values are properly escaped/quoted according to their type (integer, float, comma separated list, string (default)
- markers (as ###markername###) in all properties of 'select' (excepting andWhere) are replaced

This indirectly adds stdWrap to all properties of 'select' AND prevents SQL injection problems.

'andWhere' can become deprecated, because the only reason for its existence was stdWrap support.

Will solve problems mentioned with the solutions of issues 12094, 6882, 11220
(issue imported from #M13940)


Files

13940_trunk.diff (3.67 KB) 13940_trunk.diff Administrator Admin, 2010-03-29 10:48
13940_trunk_v3.diff (5.04 KB) 13940_trunk_v3.diff Administrator Admin, 2010-04-08 22:00
13940_tslib_content_testcase.php_v1.diff (4.89 KB) 13940_tslib_content_testcase.php_v1.diff Administrator Admin, 2010-04-08 23:45
13940_trunk_v4.diff (4.71 KB) 13940_trunk_v4.diff Administrator Admin, 2010-04-13 22:55

Related issues

Related to TYPO3 Core - Feature #17881: Enable stdWrap for select.whereClosedOliver Hader2007-12-03

Actions
Has duplicate TYPO3 Core - Feature #21169: add fullQuoteStr to stdWrapClosedSteffen Gebert2009-10-01

Actions
#1

Updated by Jigal van Hemert about 11 years ago

Example of use in TypoScript (not very realistic, but it works correctly):
10 = CONTENT
10 {
table = tt_news
select {
selectFields = title,uid
pidInList = 4
where = title > ###whatever###
markers {
whatever.data = GP:first
}
}
}

#2

Updated by Jigal van Hemert about 11 years ago

Version 3 of patch attached.

#3

Updated by Martin Holtz about 11 years ago

i added a diff for the test only.

i introduced the option markers.commaSeparatedList = 1 in the test case, but do not know, if you will implement it that way

#4

Updated by Jigal van Hemert about 11 years ago

almost ;-)
I made commaSeparatedList a property of a marker (that way you can have one marker value with a comma which is not a comma separated list and another which is):
markers {
first.value = one,two
second.value = one,two
second.commaSeparatedList = 1
}

first : 'one,two'
second : 'one','two'

#5

Updated by Steffen Kamper about 11 years ago

committed to trunk rev 7353

Also available in: Atom PDF