Project

General

Profile

Actions

Bug #16799

closed

xml2array crashes sometimes since php 5.2

Added by Luc Van Eycken over 17 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-12-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

xml2array sometimes uses strcspn with an empty first argument. This may crash apache/php, certainly since php 5.2.
The solution is to test for empty strings first (see included one-liner patch).

One could argue that this is a php 5.2 problem, but I think this is also a typo3 problem since the core is using an undocumented php feature here. In the strcspn documentation it is not mentioned how the function responds to an empty first argument. It may even depend on the underlying C-library. So I am in favor of removing this bad programming style from typo3.
(issue imported from #M4678)


Files

T3_strcspn_bug.diff (822 Bytes) T3_strcspn_bug.diff Administrator Admin, 2006-12-20 14:26
t3lib_div-PHP52.diff (877 Bytes) t3lib_div-PHP52.diff Administrator Admin, 2006-12-22 10:10

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #16780: White Page when editing Contenttype TableClosedMichael Stucki2006-12-12

Actions
Actions #1

Updated by Luc Van Eycken over 17 years ago

Silly me. Of course it is array2xml and not xml2array!

Actions #2

Updated by Martin Kutschker over 17 years ago

Patch works.

Though I would try to avoid a double strlen.

Actions #3

Updated by Dmitry Dulepov over 17 years ago

I am in favor of removing this bad programming style from typo3.

Hm. I am in favor of removing bad accusations from all BT entries.

Actions #4

Updated by Luc Van Eycken over 17 years ago

Please forgive my bad wording, I didn't want to offend anybody. On the contrary, I am impressed by the work of the Typo3 core people. So if anybody thinks this is an accusation instead of a plea to incorporate this patch, I apologize and I agree with Dmitry that these remarks should be removed from the BT.

Actions #5

Updated by Marc Wöhlken over 17 years ago

I have tested the above patch with several TYPO3 installations and it does work for all of them.

Add this patch to SVN

+1

Actions #6

Updated by Martin Kutschker over 17 years ago

Fixed in SVN.

Actions

Also available in: Atom PDF