Project

General

Profile

Actions

Bug #19920

closed

php exec() warning, on a host with exec blocked, when trying to edit localized content

Added by Kim Pihlstrm almost 16 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2009-01-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

My typo3 site is hosted on a server that has the exec() php command disabled in its configuration. This causes the typo3 backend to show a warning message when I try to edit content that has been localized and the default translation has been edited.

What the system does is that it tries to run diff through exec(), which it is not allowed to do. The exec call happens in class.t3lib_diff.php on line 173. The error message I get is:

Warning: exec() has been disabled for security reasons in /var/www/typo3_src-4.2.4/t3lib/class.t3lib_diff.php on line 173

I have tried to change [BE][disable_exec_function] in localconf.php but it does not help.

The system I am running is version 4.2.4

Possible solution would be to replace the exec() call in class.t3lib_diff.php with a purely php-coded function that does the exact same thing as the exec-call in this file.

Such a function can be found here: http://www.holomind.de/phpnet/diff2.src.php (released under the GPL). It should produce the exact same output as the *nix version of diff.

I am no expert at php (to be honest, this was my first time ever I wrote anything in php) but changing line 173 to be

$res=PHPDiff($str1,$str2);

and copying the php-diff function, from the link above, to the end of the class.t3lib_diff.php file seems to have solved my problems. At least now I do not get any warning messages and the translated content element show up as it should and I am able to edit it.
(issue imported from #M10274)


Files

class.t3lib_diff.php.patch (477 Bytes) class.t3lib_diff.php.patch Administrator Admin, 2009-02-03 10:13
Actions

Also available in: Atom PDF