Project

General

Profile

Actions

Bug #15257

closed

PHP5 breaks frontend when $TYPO3_CONF_VARS["FE"]["compressionLevel"] = 'TRUE';

Added by Torsten Schrade almost 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2005-12-04
Due date:
% Done:

0%

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

Description

When using PHP5 (5.0.4) the TYPO3 frontend just outputs <html><body></body></html> and nothing else if gzip compression is enabled and set to 'TURE' in localconf.php

Just use PHP5 and set $TYPO3_CONF_VARS["FE"]["compressionLevel"] = 'TRUE';

Apache issues a warnign about that in the logfiles:
[client 84.169.141.224] PHP Warning: gzcompress() expects parameter 2
to be long, string given in
/srv/www/typo3/typo3_src/typo3_src-3.8.1/t3lib/class.gzip_e
ncode.php on line 187
(issue imported from #M1976)


Files

1976.class.gzip_encode.diff (1.27 KB) 1976.class.gzip_encode.diff Administrator Admin, 2005-12-09 13:04
Actions #1

Updated by Peter Niederlag almost 19 years ago

I'll take care to fix this for 4.0

Actions #2

Updated by Peter Niederlag almost 19 years ago

First I'll pin down summary of my examinations on this issue and try to get some feedback:

I guess the problem is that a Type-String 'true' in PHP4 was autoconverted to Type-Boolean so a conditional construct like 'if ($level === true)' would evaluate to (boolean)true.

PHP5 seems to leave the string as string and therefor the condition won't evaluate to true anymore.

However $level can be either an (int) [1-9] or a (boolean)[true/false]. Due to TYPO3s handling of config in localconf.php all of theses values will be assigned as String. So it will need some (little) brainwork how to handle this best, if we don't want to change behaviour on setting (int)1, which would behave the same as (string)'true' if we change to 'if ($level == true)'

The original upstream-class seems not to be activly maintained anymore by now?
http://www.leknor.com/code/php/view/class.gzip_encode.php.txt

Actions #3

Updated by Peter Niederlag almost 19 years ago

Since we only have to deal with Strings (not Integers) this should work:

if (strtolower($level) 'true' || $level = true)

I'll submit a patch and afterwards close the bug.

Actions #4

Updated by old_husky69 almost 19 years ago

I remember this problem to be occurring in Typo3 3.7 as well. Was the reason not to switch to PHP5 so far...

Actions #5

Updated by Peter Niederlag almost 19 years ago

Comitted to HEAD, see patch

Actions

Also available in: Atom PDF