[TYPO3-core] RFC: Bugfix #7425: syntax error in temp_CACHE*.php
Martin Kutschker
Martin.Kutschker at n0spam-blackbox.net
Mon Feb 18 11:53:23 CET 2008
Ernesto Baschny [cron IT] schrieb:
> Steffen Kamper wrote: on 18.02.2008 10:01:
>> "Ernesto Baschny [cron IT]" <ernst at cron-it.de> schrieb im Newsbeitrag
>> news:mailman.1.1203324869.22247.typo3-team-core at lists.netfielders.de...
>>> Steffen Kamper wrote: on 06.02.2008 21:20:
>>>
>>>> Branches: Trunk only
>>>>
>>>> BT reference: http://bugs.typo3.org/view.php?id=7425
>>>>
>>>> Type: Bugfix
>>>>
>>>> Problem:
>>>>
>>>> if extensions ext_localconf.php or ext_tables.php misses php endtag,
>>>> there
>>>> is a syntax error in temp_CACHE*.php because they are merged
>>>> together, and
>>>> then such a construct leads to the syntax error:
>>>>
>>>> <?php
>>>> ....
>>>> <?php
>>>>
>>>> Solution:
>>>>
>>>> strip out php-tags and wrap with single php-tag
>>> +1 to the idea, but the preg expression is wrong. As ries already
>>> pointed out, any "?>" or "<?php" in the ext*.php will be stripped out,
>>> which might not be desired. Only leading and ending tags should be
>>> stripped. And as we also add some "<?php" and "?>" in extMgm itself,
>>> those have to be stripped too (or better not even added).
>>>
>>> Attached patch does that.
>>>
>>> Cheers,
>>> Ernesto
>>>
>>
>> Hi Ernesto,
>>
>> ries was wrong because this are no content files - it's only
>> ext_tables and localconf, so there can't be a text with <?php or ?>.
>> Sure the added were stripped too but i wrapped the whole.
>>
>> I did tests and all were correct.
>
> How do you know that there aren't <?php and ?> in the
> ext_tables/localconf files in extensions? It might be used somewhere.
> Either in some text string (e.g. for writing some PHP file) or even to
> generate some output. This:
>
> $string = '<?php echo Hi; ?>';
>
> will become this:
>
> $string = 'echo Hi;';
>
> with your patch. And this:
>
> ob_start();
> ?>
> This is my output
> <?php
> $string = ob_get_contents();
>
> will become:
>
> ob_start();
> This is my output
> $string = ob_get_contents();
>
> which is why I consider it too much to strip.
<rant>And that's why I don't like PHP files for configuration. You can do
too much.</rant> I hope that 5.0 has text/xml only configuration.
Masi
More information about the TYPO3-team-core
mailing list