[TYPO3-dev] Strange escaping problem
Ulrich Lorenz PHZ Luzern
lorenz.ulrich at phz.ch
Wed May 12 11:39:45 CEST 2010
Hi there
The following query is spart of T3BLOG:
$resContent = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid, CType, bodytext', // SELECT ...
'tt_content', // FROM ...
'irre_parentid = ' . $row['uid'] .
' AND irre_parenttable=\'tx_t3blog_post\' ' .
$this->localcObj->enableFields('tt_content'),
'uid', // GROUP BY ...
'sorting' // ORDER BY ...
);
So as you can see ' AND irre_parenttable=\'tx_t3blog_post\' ' is escaped
correctly.
Since I got no content output from T3BLOG (title, permalink etc. works
fine) I activated SQL debug:
SELECT *
FROM tt_content
WHERE
tt_content.pid IN (374) AND colPos=0 AND sys_language_uid IN (0) AND
irre_parenttable = \\'tx_t3blog_post\\' AND irre_parentid = 25 AND uid
in ( 1060 ) AND tt_content.deleted=0 AND tt_content.t3ver_state<=0 AND
tt_content.hidden=0 AND (tt_content.starttime<=1273656780) AND
(tt_content.endtime=0 OR tt_content.endtime>1273656780) AND
(tt_content.fe_group='' OR tt_content.fe_group IS NULL OR
tt_content.fe_group='0' OR (tt_content.fe_group LIKE '%,0,%' OR
tt_content.fe_group LIKE '0,%' OR tt_content.fe_group LIKE '%,0' OR
tt_content.fe_group='0') OR (tt_content.fe_group LIKE '%,-1,%' OR
tt_content.fe_group LIKE '-1,%' OR tt_content.fe_group LIKE '%,-1' OR
tt_content.fe_group='-1'))
ORDER BY sorting
So you see it can't work because now irre_parenttable =
\\'tx_t3blog_post\\' is even escaped twice.
As an alternative I tried
" AND irre_parenttable='tx_t3blog_post' "
but even then I get the same sql debug output. I never had any problems
with exec_SELECTquery so I'm very surprised about that behavior.
T3BLOG 0.8.3
TYPO3 4.2.12
Thanks for your advice.
Lorenz
More information about the TYPO3-dev
mailing list