FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 10-08-2008, 11:35 AM
Kai Schaetzl
 
Default Weird problem in PHP 5.1.6/possible bug

I hit a weird problem with the default PHP 5.1.6 on CentoS 5.2.

It seems the default 5.1.6 PHP on CentOS has a bug in the functions
escapeshellargs/escapeshellcmd: it "gulps" any special (non-ASCII)
characters, so that they are missing from the output. I have been assured
that this does not happen on other 5.1.6 or newer on other Linux
distributions. I don't see this behavior with the exact same $LANG setting
(en_US.UTF8) on CentOS 4.
Moreover the behavior is different when running the script via console or
webserver. If I run on console with my $LANG setting of en_US.UTF8 I get
correct output if the input is UTF-8 (which is still incorrect, if the
encoding doesn't match it should output garbage and not "nothing"). Via
webserver I still get no output with the same characters and encoding of
the page set to UTF-8.
Could others check on what they have available (other PHP, other
distributions) and tell the results?

a test page:
<?
$test = "";
print $test;
print "<br>
";
print escapeshellarg($test);
print "<br>
";
$test = "äöü????";
print $test;
print "<br>
";
print escapeshellarg($test);
?>

It will output German umlauts in ISO-8859-1 and UTF-8. Depending on your
$LANG setting and the coding set to the webpage you may either get some
correct characters or garbage between '. The main point is that the
respective output for lines 1 and 2 and for lines 3 and 4 should be
*identical* with the exception of the outer single quotes.
The function is supposed to escape single quotes and do nothing else with
the input (e.g. output "as is").
If the output is only ', then there is a bug.

Kai

--
Kai Schtzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-08-2008, 02:15 PM
Kai Schaetzl
 
Default Weird problem in PHP 5.1.6/possible bug

It's not specific to CentOS. I found this bug report
http://bugs.php.net/bug.php?id=44945

It seems that PHP 5 runs with no locale at all and doesn't have access to
$LANG either. That bug got closed, still I think it's a bug. At least it
doesn't behave like documented.

Kai

--
Kai Schtzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-12-2008, 07:34 PM
Patrick
 
Default Weird problem in PHP 5.1.6/possible bug

Kai Schaetzl wrote:

Could others check on what they have available (other PHP, other
distributions) and tell the results?




Linux Apache 2.6.9-55.0.2.EL #1 Tue Jun 26 14:08:18 EDT 2007 i686
CentOS release 4.5 (Final)
PHP Version 5.2.5


Output:

äöüÄÖÜß
'äöüÄÖÜß'
äöüÄÖÜß
'äöüÄÖÜß'

>The main point is that the
>respective output for lines 1 and 2 and for lines 3 and 4 should be
>*identical* with the exception of the outer single quotes.

See above (hope it helps out).

Patrick


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-13-2008, 01:18 PM
Kai Schaetzl
 
Default Weird problem in PHP 5.1.6/possible bug

Patrick wrote on Sun, 12 Oct 2008 15:34:03 -0400:

> See above (hope it helps out).

As you might have seen I actually found a workaround. Your findings on
CentOS 4 suggest that it is a specific problem on the CentOS/RHEL 5
platform. The PHP 5 coming with CentOS 5 is set to a locale of C and
doesn't match the locale of the system! I guess I file a bug now. Thanks!

Kai

--
Kai Schtzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-14-2008, 08:48 PM
Patrick
 
Default Weird problem in PHP 5.1.6/possible bug

Kai Schaetzl wrote:

As you might have seen I actually found a workaround. Your findings on
CentOS 4 suggest that it is a specific problem on the CentOS/RHEL 5
platform. The PHP 5 coming with CentOS 5 is set to a locale of C and
doesn't match the locale of the system! I guess I file a bug now. Thanks!


Kai


No problem !!

:-)

Patrick


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 11:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org